Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3215342
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:09:59+00:00 2026-05-17T15:09:59+00:00

What is going on?! I fixed some structs, extensive amount of search/replace in my

  • 0

What is going on?! I fixed some structs, extensive amount of search/replace in my code. Then i finish and everything compiles fine, but the program crashes immediately.

This is my main function:

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){
    exit(1);

In all logics it shouldnt crash, since im not executing any functions. only WinMain(), which does nothing!

What the hell? And why its not giving me the line numbers anymore? its giving the location in the external include files, not the line in MY code.

Also i noticed my EXE size is now 5 times smaller than it was before, which also doesnt make sense, looks like it stops compiling at some point, but still says its compiled!

Edit: this is what i get from the error:

File: ... \include\xstring
Line: 1084
Expression: Invalid null pointer

When i run it in non-debug mode i get First-chance exception at 0x00413a95 ....: 0xC0000005: Access violation reading location 0x00000000.

—

Edit2: reason found: I initialized a global struct in the following way: const StructName VarName = {1, 1, 1}; but the StructName Struct was changed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:10:00+00:00Added an answer on May 17, 2026 at 3:10 pm

    As @sbi said, it’s likely global/static objects. In my experience, this (often?) happens if a string object is in a global scope which is referenced by other global object/initialization code. Due to non-deterministic initialization order, the string can be used before it has been constructed. I’d look for those cases (well, and avoid global code if possible).

    On a side note, this can happen with any objects, not just strings. It’s usually not that the object wasn’t initialized properly, but rather that something is using it before it’s initialized (although @sbi’s answer could also be the cause).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Been going over my predecessor's code and see usage of the request scope frequently.
I was reviewing some of my old code and I have a method that
Going back to my previous question on OCSP, does anybody know of reliable OCSP
While going through university and from following the development of SO, I've heard a
After going through the Appendix A, C# Coding Style Conventions of the great book
What's going on here? printf.sh: #! /bin/sh NAME=George W. Bush printf Hello, %s\n $NAME
I'm going to start a new project - rewriting an existing system (PHP +
I am going to be using C/C++, and would like to know the best
I'm going to build an API for a web app and I'm interested in
Is my best be going to be a shell script which replaces symlinks with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.