|
In C#, when calling a GUI control from another thread, you can use Control.IsInvokeRequired and Control.Invoke.
I am looking for the C++ equivalent (when using CWnd).
Any ideas?
|
|
|
|
|
Typically UI processing is all done on one thread.
You can post messages from another thread to windows created
on the UI thread. The posted messages will be queued and processed
on the UI thread.
I've personally never needed a "IsInvokeRequired" since I generally
know if I'm writing UI thread code or not.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
I want to open network connection dialog, how can i do so?
thanks in advance
|
|
|
|
|
I'm not sure if this is what you're looking for, but you can find a windows app called rasphone.exe in C:\Windows\System32.
So, something like this might help:
ShellExecute(0, 0, _T("rasphone.exe"), 0, 0, SW_SHOW);
When you execute that, it will let you connect, disconnect, and edit properties of you network connections.
Hope it helps.
|
|
|
|
|
Have you tried SHGetFolderLocation(NULL, CSIDL_CONNECTIONS, ...) ? That would get you a PIDL that can then be used to obtain the actual path of the "Network Connections" virtual folder.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
The control panel "dialog"?
If so...
// On Vista:
::CreateProcess(_T("C:\\Windows\\System32\\control.exe"),
_T(" /name Microsoft.NetworkAndSharingCenter"),
...
// On older OSs (I didn't test this):
::CreateProcess(_T("C:\\Windows\\System32\\control.exe"),
_T(" ncpa.cpl"),
...
And if that's the wrong dialog, never mind
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thanks for your solution it worked for vista but the one which you gave for lower version is not working(xp i have checked)....
|
|
|
|
|
sorry its working thanks for your answer
|
|
|
|
|
Hi All,
I just want to know how to create folders using Vc++ code...
Thanks & Regards
Anitha
|
|
|
|
|
You may use the Win32 API CreateDirectory to create a new folder.
If the function succeeds, the return value will be nonzero.
Regards,
Rane
|
|
|
|
|
Im using MFC (dialog based application).
|
|
|
|
|
Hi,
You can use WIN32 API in MFC also..
The price of anything is the amount of life you exchange for it.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
Here is sample code for what Rane says:
if (::<code>CreateDirectory</code>("C:\\temp\\", NULL) == 0)
{
}
else
{
}
zafer
|
|
|
|
|
Hi,
Can anybody tell me why am I not getting Value's data in below code, in buffer 'pszRegValData' ? The surprising thing is that I am able to receive other value's data in it which has REG_SZ datatype... but the value for which it's not giving any output has REG_SZ as a datatype too.. data for it is "04/26/2007 10:20:01".. It's not giving me data in buffer(pszRegValData) for REG_BINARY too...
retCode = RegEnumValue(hkScanKey, i,
szRegValueName,
&dwRegValNameLen,
NULL,
&dwRegValType,
(LPBYTE)pszRegValData,
&dwRegValLen);
Thanks in advance.
regards,
Supriya Tonape
|
|
|
|
|
also the error code I get is '234' though I am making sure that buffer has enough size to hold the returned data...
|
|
|
|
|
Supriya Tonape wrote: also the error code I get is '234'...
Which is not an error, but means that more data is available.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
thanks for the reply. But I am already making sure that buffer size is enough to store the data...by API 'RegQueryInfoKey()' I am getting max length of value's data.. I am executing it before 'RegEnumValue()' and allocating the buffer for value (length returned by 'RegQueryInfoKey' + 1)... still why 234 error ?
|
|
|
|
|
Supriya Tonape wrote: ...still why 234 error ?
It's not an error, but means that more data is available.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I just traced my code and found that for every character it's taking 2 bytes.. and I am allocatiing buffer as per length returned by 'RegQueryInfoKey' which returned length of longest value data... for example actual date string/data(REG_SZ) length is 20 but when 'RegEnumValue' gets the date string/data, the length returned is 40(in last param of 'RegEnumValue').... So I doubled my buffer's size but still it gives me same problem... any suggestions ? I am running my 'console' appln on 32 bit intel proc with 32-bit XP OS on it...
|
|
|
|
|
|
I resolved the prob, after each call we need to set the data buffer size back to max value length... sadly this is not quoted in MSDN! it's hard to understand whats going on wrong in code when MSDN says everytime 'RegEnumValue' iterates thru reg values,it returns the data length... I wasted my night for this silly problem...
|
|
|
|
|
...
I will try that. But I have alread wasted a whole weekend until I see your post
...
|
|
|
|
|
Hi all..
I have one file and i want to move it to the temporary path....
can anyone help me..
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
manju#123 wrote: can anyone help me..
With moving the file or figuring out what your temporary folder is?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Use the GetTempPath() function to retrieve the path of the temporary files directory - see the documentation here.
Then to copy the file use the CopyFile() or CopyFileEx() function to copy the file to the temporary directory.
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|