|
I don't know... I don't think there is one.
I believe the class name exists in CDialog. CDialog has a create that takes
-- Create( LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL );
Where I think the 1st argument is what FindWindow looks for. However, I fail to find a simular thing in CPropertySheet.
|
|
|
|
|
I'm afraid that class name has nothing to do with any template: indeed, the class name for dialogs is "DIALOG" (and for buttons is "BUTTON", for texts is "STATIC").
To find out, you just have to investigate any property sheet with a small program called Spy++ that comes as part of your Visual Studio. I happen not to have this program handy right now.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have functions that both "delete" two buffer allocated by "new." This has to be done because the functions can be used in different ways. I was just wondering is there a way to know if the memory has already been deleted and so don't do it again?
|
|
|
|
|
After you've deleted the memory, set the pointer to NULL. Before you try to delete again, check to see if the pointer is NULL.
Michael
|
|
|
|
|
After you delete the buffers, set their pointers to NULL. Then, to see if the buffers currently point to any memory, you can test their pointers against NULL.
Jon Sagara
What about ?
"Teve Torbes, I've only got one thing to say to you: Tuck Off!" -- Dob Bole
|
|
|
|
|
If single threaded use this:
----------------------------
extern char * buf;
void func1(){
if (buf) { delete buf;buf == NULL;}
}
void func2(){
if (buf) { delete buf;buf = NULL;}
}
If multi threaded use this :
----------------------------
extern char * buf;
extern CRITICAL_SECTION cs1;
void func1(){
EnterCriticalSection(&cs1);
if (buf) { delete buf;buf=NULL; }
LeaveCriticalSection(&cs1);
}
// same for func2
// see MSDN for use of CriticalSection
|
|
|
|
|
I am trying to call a DLL function from InstallShield but the setup always give me an error "DLL Function
call crashed".
The DLL is loaded successfully and the function is called as well but what happens after that is my
big problem!
My DLL is built using MFC Wizard, I defined the exported DLL in .DEF
Please help me, what wrong did I do? May be I should create the DLL in another way!?
|
|
|
|
|
It is hard to say without having more info. One wild guess: have you tried declaring your function with the WINAPI specifier?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
No, I did not use WINAPI. Now after I used it, the problem was solved but I have another error message: "DLL function call resulted in bad stack. Possible incorrect prototyping".
The function declaration in the DLL is:
long WINAPI CApp::SetFunction()
The prototype declaration in InstallShield is:
Prototype stdcall long MyDll.SetFunction();
I tried using the other declaration:
Prototype cdecl long MyDll.SetFunction();
What should I do?! Thank you for you help.
|
|
|
|
|
Is by chance your function non-static ?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
If you can afford declaring it as static , I think that'd solve the problem.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
If i decalre my function as static, then i cannot export it, then the InstallShield will not be able to find my function and read it. I guess my problem is when the value is returned to InstallShield. Can you please explain to me more why you suggested the static function? may be i am missing a something here?
|
|
|
|
|
If I'm not wrong, your function is not a stand alone function, but rather a member function of a class of yours named CApp . Then, declaring it as static does not have the same meaning as with a stand alone function, it merely says that this member function can be called without bounding to any instance of CApp . Try modifying your .h like this:
class CApp{
...
static long WINAPI SetFunction();
...); and do not make any other change: this should fix the problem.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Yes, my function is not a stand alone function, it is a member function of a class. I tried to declare it the way you told me but it didn't work either
I am thinking that may be i built the DLL in a wrong way? My DLL was built using MFC App Wizard (Dynamic DLL). Can you advice me if what I did is wrong or what type of DLL I should use?
Thank you.
|
|
|
|
|
Dynamic MFC linking... Check MSDN article HOWTO: Properly Export Functions Using the MFC Shared Library (Q140850).
Apart from this, rest asured that an MFC DLL can be called from InstallShield (hey, I did it ). I'd need some code snippets to be able to tell you more about your problem (if the AFX_MANAGE_STATE didn't fix it).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I want to make flat-toolbar,like office 2000 or VC++,etc.
I downloaded many Flat Tool-Bar sample.But Enyone use CToolbarEx.I want to use it easily,I don't want to spend 'Looking'.
Please tell me better source.
|
|
|
|
|
I have a web page displayed in a CWebBrowser2 control. The print the contents of the web page is use ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, NULL, NULL); . This displays the standard print dialog window and allows the user to select the printer to print with. If I use OLECMDEXECOPT_DONTPROMPTUSER the default printer is used.
I'd like to specify which printer to print to without displaying the default print dialog window. Can I use the last two ExecWB parmeters perhaps?
Anyone got any ideas please?
Jeremy Davis
http://www.astad.org
|
|
|
|
|
Hello,
I'm trying to query whether the PC has a soundcard or not. I #include <mmsystem.h>, and I try to use waveOutGetNumDevs(), but I get the following linker error.
MainFrm.obj : error LNK2001: unresolved external symbol __imp__waveOutGetNumDevs@0
Debug/Clockster.exe : fatal error LNK1120: 1 unresolved externals
What am I missing? Thanks in advance.
Marcus
Make no little plans; they have no magic to stir your blood to action. Make big plans, aim high in work and hope
-- Daniel Burnham
|
|
|
|
|
do you link to the "Winmm.lib" ?
Project Settings / Linker and add that library to the list..
i have not used this function ever before.. but i think this should work
bernhard
Sometimes I think the surest sign for intelligent life elsewhere in
the universe is that none of them ever tried to contact us.
|
|
|
|
|
Add this to your stdafx.h
#pragma comment(lib, "winmm")
- God bless the World
|
|
|
|
|
Gentlemen,
Thank you for the solutions. I went Ernest's so that I can keep it in the source files. Have a good one...
Marcus
Make no little plans; they have no magic to stir your blood to action. Make big plans, aim high in work and hope
-- Daniel Burnham
|
|
|
|
|
I'm trying to make a model rocket simulation where the user can selection file>options from the menu, enter in the rocket data and I'll display a simulation of the rocket flying in the air.
I have the dialog box get the data, I have the functions to do the actual simulation, now I just need to know how to get that data from the dialog box once the user hits OK and then draw the results (I know about the draw functions using dc, but not how to properly implement them in this case).
Also, I have three functions which I use for the simulation, what class should I make them a part of (one does the math, other draws and the third calls the other two).
ie.
void doSimulation()
{
//get data (gravity, mass, etc) from dialog box
for (i=0;i
|
|
|
|
|
Maybe MFC sample Fire can help you. This is dialog-based application with lot of controls and dynamically created image. User changes fire parameters and program redraws the image according to them. You can use this fire for your rocket...
|
|
|
|
|
Just an inquiry...
How do I implement my program so that if I made it an executable file, it's possible to pass "arguments/parameters" to the executable file when it is called...
i.e.
if I made my BOOk Program as an executable file
and I want my executable file of the Book program to accept video file parameters, how do I do this?
In analogy, if i want to open the realplayer.Exe, i command a SHELLEXECUTE with the *.rm file as paramenter and the realplayer automatically opens it.
Thanks in Advance. Best Wishes to all.
|
|
|
|