|
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
|
|
|
|
|
Hi,
I'm in need of a conversion routine to convert a string into a integer(long). I'm relying on CRT function _tcstol to do this. Below shown is my approach:
main()
{
_TCHAR *q = 0;
char txt[] = "5x";
long l = _tcstol(txt, &q, 10);
if (q && _tcsclen(q))
{
cout<<"Invalid Integer";
}
}
I'm relying on parameter2 in _tcstol to validate a integer. (i.e)the endptr Pointer to character that stops scan.
Will this approach work fine in all cases?
Thanks in Advance
Rane
|
|
|
|
|
Hello,
yes, I would do the same as you did for converting a string to an integer. By the way, have you looked at this thread[^]?
Best regards,
Mihai Moga
|
|
|
|
|
Hi all,
i m using SDI type application.
If i m change Screen resolution thru display properties of computer than it takes effect on my application.
the all forms and control size are varies.
so please tell me how can i adjust size of all forms,dialog or controls even if i change screen resolution.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hello,
I do not know if there is an easy way to solve your problem. I think you need to call CWnd::SetFont[^] method for all your dialogs.
Best regards,
Mihai Moga
|
|
|
|