|
during creation of dialog, how can i store the hwnd in an array so i can later destroy them, and would it be better to PostMessage(WM_QUIT)?
Thanks in advance
shotgun
|
|
|
|
|
Assuming you're creating lots of dialogs, surely you have some handle on them generally, such as a variable ? That gives you the HWND. Storing them in a vector is not a bad way of going about it, just remember if you're storing pointers that you need to delete them yourself.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Posting a WM_QUIT makes the thread's message loop end, which is probably not what you want. Modeless dialogs are properly destroyed with DestroyWindow() .
--Mike--
"alyson hannigan is so cute it's crazy" -- Googlism
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I converted an mfc dll project into an extension one, and I can't link as long as I keep DllMain. (Reason of conversion).
I need notifications of thread start and termination in the dll, which is why I converted it to an extension dll, letting me have my own dllmain. Or is it some other way to catch DLL_THREAD_DETACH in a regular mfc dll?
dump of output window:
Linking...
mfcs70d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in Hugonet DebugMonitor.obj
mfcs70d.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in Hugonet DebugMonitor.obj; second definition ignored
Creating library d:\x.lib and object D:\x.exp
D:\x.dll : fatal error LNK1169: one or more multiply defined symbols found
|
|
|
|
|
MFC extension DLLs do not have DllMain or a CWinApp object. You'll need to export a special initialization function, which the EXE using the DLL calls during its own startup (such as InitInstance() ).
If you make a dummy extension DLL project with the AppWizard, you'll see that I mean. There are comments in the wizard-generated code that explain it further.
--Mike--
"alyson hannigan is so cute it's crazy" -- Googlism
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
You are wrong.
Create a dummy Extension dll, and you'll see what I mean
|
|
|
|
|
How can I add a chat interface client into my MFC dialog app, without using IRC (IRC is too unsecure)? The server should be no problem (has mySQL), but I need to know of a good IRC-alternative for a MFC app.
Thanks!
|
|
|
|
|
I don't know if I have understand you right but:
Learn Winsock!
Then build your own client/server chat program!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
I created a simple blank workspace app in VC++6.0 and calls int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow){
blah blah...} for my main program
I compiled a release but I want a different Icon for the final .exe, right now it just shows the default windows console looking thingy icon.
Any methods/code on changing this?
Thanks
Joe
|
|
|
|
|
when you are defining your class, at the point where you define the icon...you write something like this:
wndclass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(MY_ICON_HERE));
that's all...
|
|
|
|
|
Well, I can't get that to work b/c I have new classes in this project. The program simply minimizes all current windows and opens the default webbrowser.
I wonder if I have imported my icon in VC++6 correctly b/c there still is no resources tab, when viewing the Workspace, it does compile though
|
|
|
|
|
I figured it out, I needed to add the Script1.rc file it created to my project Thanks!!
"I'd rather be a smart ass, than a dumb ass"
|
|
|
|
|
Hi, I am learning C++ and I was wondering If someone could give me an example on how to Shell an EXE with a DLL.. (For example.. when the DLL is loaded into memory, it loads an EXE)
Thanks
|
|
|
|
|
Hi All,
I need some help. I was wondering if there is a way to initialize a list box so that it shows the values already in the listbox when the program starts. The thing is that I have to display 777777 values and I currently load the listbox using a thread, but it takes like 8 minutes to load all the values. So I was wondering if there is a way to load the strings into the listbox before the window loads. Thanks for help.
|
|
|
|
|
look around here, at codeproject, there's a "virtual" listbox that's made just for that.
Max.
|
|
|
|
|
Hi,
I have 2 edit boxes on a dialog box. I have associated two member variables for these edit boxes. However, the variables don't seem to get the data I type in the boxes.
Any suggestions on what I'm doing wrong?
|
|
|
|
|
the variables are only updated when you call UpdataData.
-c
A conclusion is simply the place where someone got tired of thinking.
|
|
|
|
|
How Locate the error when meet the leak as follow?
/////////////////
Detected memory leaks!
Dumping objects ->
{46} client block at 0x009C2590, subtype 0, 100 bytes long.
a CWnd object at $009C2590, 100 bytes long
Object dump complete.
The thread 0x244 has exited with code 0 (0x0).
//////////////////////
thanks in advance!!
|
|
|
|
|
how do u get those wonderful information?
includeh10
|
|
|
|
|
it's in the VC debugger's output window
A conclusion is simply the place where someone got tired of thinking.
|
|
|
|
|
|
1. find out where you allocated a CWnd.
2. determine where you can it.
3. delete it.
-c
A conclusion is simply the place where someone got tired of thinking.
|
|
|
|
|
If there is a method to tell which CWnd is not delete?
thanks!
|
|
|
|
|
Look at default c++ files generated by Visual C++, they usually/always have a few preprocessor lines at the beginning that enable additional debugging info, as well as leak information; if it's defined, the leak is identified, with the code line where the allocation was made.
Max.
|
|
|
|
|
Since you've already got that intel, I think you may have seen Detecting and Isolating Memory Leaks Using Microsoft Visual C++[^].
Further in that article, there's a section called Comparing Memory States. If you suspect code that's leaking, wrap it with a call to checkpoint the memory before, and after, then compare. The article gives an example.
|
|
|
|