|
Hm, I also thought of a nonmodal dialog.
But I have to wait in my application for the end of a nonmodal dialog.
So, I have to do the following:
ShellExecute()
Create Dialog
Show Dialog without activating it (how can I do this??)
Wait for End of Dialog (how can I do this?)
Continue with my program based on the results of my nonmodal dialog
I haven't done a lot with nonmodal dialogs, but I will learn...
Juergen
|
|
|
|
|
e-DJ wrote: ShellExecute()
Create Dialog
Show Dialog without activating it (how can I do this??)
Wait for End of Dialog (how can I do this?)
Create Dialog:
CMyDialog md;
Show Dialog without activating it : there is an option in the resource editor to start a dialog unvisible.
Wait for End of Dialog : Post a custom message when the dialog is destroyed to your main application. In the main application, simply wait for the message.
PS: David's remark is good, but I think this is what you already started to do.
PS2: Ein Juergen in USA ? Bist du wirklich ein Ami ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
I managed to display my dialog as modeless. But How can I wat in my Application for a posted message?
Background:
I have a listctrl. This list displays a lot of filenames. The user makes a dblclick and the file is opened. I then add an entry in my database, that the user has started this file and ask, if it was useful for him. Then I add another entry in my database.
Right now, my algorithm looks like this:
OnDblClick:
Get klicked filename
ShellExecute
Display MessageBox
When it was of use, add entry in database
increment hitcounter in database
It is my own ListCtrl derived from CListCtrl. I was not able to call a dialogbox of my application from inside my ListCtrl (which makes sense, because my ListCtrl does not know about my application). So I initialised my modeless dialog in my application and pass a pointer to this dialog to my ListCtrl. However, my ListCtrl only accepts CDialog as pointer, therefore I can not access members of my modeless dialog.
So after doing a ShellExecute, I just show my previously created modeless dialog and have to wait in my DblClick-handler for the end of my modeless dialog. Sound difficult. Otherwise I have to completely reconstruct my ListCtrl.
Juergen
PS. Ich bin nicht aus Amerika, sondern lebe in Deutschland. Wie kommst Du darauf, ich wär Ami?
|
|
|
|
|
Don't display the message box until after the program that ShellExecuteEx() spawned has finished. It makes no sense to ask if the file was of any help if the message box comes up first.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I want to write a program in Visual C++ to transfer data between a computers and microcontroller via 10/100 Ethernet RJ-45.
What i need (libraries, or is there any help in MSDN.)
What i figured out is that i need "winsock" for programming.(TCP client and TCP Server)
Where should I start.
thanks
|
|
|
|
|
|
How about here[^] and related articles.
By the way, posting to multiple forums isn't necessarily a good idea...
Steve S
Developer for hire
|
|
|
|
|
In my application I hook Windows registry query's and read direct them to a file. I use the following code:
<br />
LONG __stdcall Mine_RegQueryValueExA(<br />
HKEY hKey,<br />
LPCTSTR lpValueName,<br />
LPDWORD lpReserved,<br />
LPDWORD lpType,<br />
LPBYTE lpData,<br />
LPDWORD lpcbData<br />
)<br />
<br />
{<br />
char * filename = "\\testapp.ini"; <br />
char buffer[_MAX_PATH];<br />
_getcwd(buffer, _MAX_PATH); <br />
strcat(buffer, filename);<br />
LPTSTR lpReturnedString = "";<br />
unsigned int nSize = MAX_PATH;<br />
GetPrivateProfileStringA("Section" , lpValueName, "\255", lpReturnedString, nSize, buffer);<br />
lpData = reinterpret_cast <LPBYTE> (lpReturnedString);<br />
LONG rv = ERROR_SUCCESS;<br />
return rv;<br />
<br />
<br />
__try {<br />
rv = Real_RegQueryValueExA (hKey,lpValueName,lpReserved,lpType,lpData,lpcbData);<br />
} __finally {};<br />
<br />
return rv<br />
}<br />
Now in a number of cases I get an error the the GetPrivateProfileString line along he lines of 'The memory could not be "written"'. Can anyone see what is causing this error as I really have no idea.
Thanks
|
|
|
|
|
nSize is set to MAX_PATH whereas buffer is of size _MAXPATH. Do these match ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
stevelam wrote: LPTSTR lpReturnedString = "";
unsigned int nSize = MAX_PATH;
GetPrivateProfileStringA("Section" , lpValueName, "\255", lpReturnedString, nSize, buffer);
watch fourth parameter, it should be like this
char ReturnedString [ MAX_PATH + 1 ] ;
unsigned int nSize = MAX_PATH+1;
GetPrivateProfileStringA("Section" , lpValueName, "\255", ReturnedString , nSize, buffer);
|
|
|
|
|
|
stevelam wrote: LPTSTR lpReturnedString = "";
unsigned int nSize = MAX_PATH;
GetPrivateProfileStringA("Section" , lpValueName, "\255", lpReturnedString, nSize, buffer);
lpReturnedString is a static string of size 1 (end of string character only). If you try to copy something in it, you will write outside the boundary of the allocated memory and thus overwriting memory you cannot write to.
Use a fixed size array instead ans pass its maximum capacity in the nSize paramter of the function.
|
|
|
|
|
I was given an application that calls a driver which also calls interrupts at H/W level in order to update that BIOS of a ceratin laptop. However, I was asked to develop the application in such a way that I won't have to install the driver any more just to activate the interrupts for the BIOS update. Is it possible to do so and if yes, how can I proceed. The application by the way was made in Visual C++ ver. 6.0 so I assume that this is the right section for my query. Thanks a lot.
|
|
|
|
|
User mode code cannot directly control the hardware. You need the device driver to be able to do this.
|
|
|
|
|
Thank you for the reply. However, I think I was not able to clarify my question. What I meant with the skipping of the device driver is the avoidance of installing the driver manually. As such, I was thinking
of dynamic loading of drivers but I have no idea about this and if this is applicable for all types of drivers. Thanks again.
|
|
|
|
|
Hi all,
I would like to know, if someone knows how to get the physical address of an IP address for example(This is just an example):
192.168.0.100 -> www.sitename.com
I would like to resolve to IP address.
Many Thanx
Regards
Programm3r
|
|
|
|
|
Programm3r wrote: resolve to IP address
gethostbyname()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanx....
Regards
Programm3r
|
|
|
|
|
hello,friends.can you give some codes about content-based audio retrieval or ActiveX control modules,thank you a lot.
|
|
|
|
|
Requests along the lines of 'please write this for me' rarely get answered. What are you trying to do exactly ? What have you already done ? Where do you need help ? The more you show that you've done more than ask someone else to write your code, the more answers you will get.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Is there any control that can display the waveform of an audio file and can start, pause, resume and stop the playing of the audio file?
curiosity
|
|
|
|
|
The windows media player control can play it, I wonder if there's a visualisation that just shows the waveform ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: I wonder if there's a visualisation that just shows the waveform
yes, the "oscilloscop" visualization does it. but i am not sure you can select it from outside WMP...
|
|
|
|
|
Hello,
I am facing a unique problem, that even if I include the header file, yet the class is not recognized. It gives me the error missing ; before (some variable) and errors generated subsequently. Please help.
Thanks and regards,
Software Developer
Sanjay Khapre
|
|
|
|
|
See if class declaration is suppressed by some preprocessors.
Can you show how class is declared,included and used ?
|
|
|
|