[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

Release mode and Debug mode

I am now using Visual C++ 6.0.

I got a program when I compile it as a exe file. It works fine in both Debug mode and Release mode. But without making any changes to the coding, when I complie it as a dll file.  It perform an illegal operations and hangs my machine...... in the release mode only but not in the debug mode.....

What's happen?

it is my program error or the complier have error?

Thanks

Sum
0
sumsumsum
Asked:
sumsumsum
  • 2
1 Solution
 
nietodCommented:
>> without making any changes to the coding,
>> when I complie it as a dll file.  It perform an
>> illegal operations and hangs my machine
How can the same code be both an EXE (with a main() or WinMain() function AND a DLL with a DllMain() function.) without changes?  You must be making changes.  what are you changing?

>> in the release mode only but not in the debug mode
Add debugging symboles to the release mode and run it under the debugger to try to determine where it is hanging.

>> it is my program error or the complier have error?
It could be ANYTHING.  There is no way we could tell you with the amount of information we have to work with.  It is likely to be but in your code, but we don't know anythig about it.
0
 
GlennDeanCommented:
I believe, at a minimum, you'd have to add the /dll linker option so the entry becomes DllMain (as mentioned by Nietod) and then you'd obviously have to export DllMain.
0
 
alexoCommented:
Make sure to set warning level to 4.
0
 
alexoCommented:
Since you accepted my comment as an answer it must have helped...
Could you post what the problem turned out to be?
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now