|
sachin_chakote wrote: i tried static variable , extern could not solve my problem ..
The purpoue of extern is to solve this situation. Check out this link[^].
Well, I recommend to go for a singleton class[^] with name CGlobalData [according to your choice], and make all your required global variables as its members. Then you could access your singleton class from all cpp files and can access the global data as well. Its more object oriented and more easier to maintain than global variables.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi all,
what can i use for coversion of long to CString.
i m try this.
it is right
<br />
long num=0;<br />
CString str=_T("");<br />
str.Format("%2d",num);<br />
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
|
|
|
|
|
|
You could use itoa()[^] as well.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Your solution should work in environments where an 'int' is 4-bytes (=equivalent to 'long').
str.Format("%ld",num);<br /> should work everywhere (the 'l'-prefix indicates that 'num' is a long decimal).
|
|
|
|
|
So please tell me what can i use that is use everywhere.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi all,
i've notice that InternetGetCookie API doesn't work with firefox...
firefox store the cookie differently and even under different location
can any1 help me on how to read values from firefox cookies?
thanks in advanced
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
I have created Property Sheet and Pages using Win32 SDK. Now I need to modify a edit box on a Page. The piece of code is
HWND hPropSheet = GetActiveWindow();
HWND hPropPage0=PropSheet_GetCurrentPageHwnd(hDlg);
SetDlgItemText(hPropPage0,IDC_EDIT1,(LPCWSTR)szBuffer);
Is this correct? I am not able to get the Handle to window to the Property Sheet ..... Please help
|
|
|
|
|
koumodaki wrote: HWND hPropPage0=PropSheet_GetCurrentPageHwnd(hDlg);
What is hDlg ?
"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
|
|
|
|
|
Oops my bad.
its
HWND hPropPage0=PropSheet_GetCurrentPageHwnd(hPropSheet );
Sorry for the confusion.
|
|
|
|
|
HI,
How do i read a Tree.I need to read the Tree from Root Item to all its childs.Iam not able to give logic. Plz help me
Thanks,
|
|
|
|
|
Did you see CTreeCtrl::GetRootItem/GetNextItem/GetSelectedItem?
|
|
|
|
|
Hi all,
I want to get my hard disk name I am using WMI to get it. I have Initialized com using CoInitializeEx, then i have set security levels using CoInitializeSecurity, then i Obtain the initial locator to WMI, then i have Connected to WMI through the IWbemLocator::ConnectServer method but my problem is i am not getting the right api to get hard disk name.. how can i get it???
IWbemServices *pSvc = NULL;
hres = pLoc->ConnectServer(
_bstr_t(L"ROOT\\CIMV2"),
NULL,
NULL,
0,
NULL,
0,
0,
&pSvc
);
can anybody help me in this
thanks in advance
|
|
|
|
|
First of all Set IWbemServices proxy security so that WMI service can impersonate the client by calling CoSetProxyBlanket.
Then Get Physical disks Installed on the system using ExecQuery().
|
|
|
|
|
can u tell me this through some example, or can u provide me with some link
|
|
|
|
|
Did you try to execute query using pSvc like
example from MSDN
IEnumWbemClassObject* pEnumerator = NULL;
hres = pSvc->ExecQuery(
bstr_t("WQL"),
bstr_t("SELECT * FROM Win32_OperatingSystem"),
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
NULL,
&pEnumerator);
for disk information
you have to try some thing like
SELECT * from Win32_DiskDrive
I hope it helps.
Regards,
Sandip.
|
|
|
|
|
SandipG wrote: for disk information
you have to try some thing like
SELECT * from Win32_DiskDrive
Which property were you thinking would hold the volume name? Perhaps you meant Win32_LogicalDisk instead.
"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
|
|
|
|
|
Oops, i didn't see that OP mentioned volume name.
But for volume names do we need WMI, i think we have some API.
GetVolumeInformation or something not sure.. Am i correct??
Regards,
Sandip.
|
|
|
|
|
SandipG wrote: But for volume names do we need WMI...
No, but the OP asked for it.
SandipG wrote: ...i think we have some API. GetVolumeInformation or something not sure.. Am i correct??
Yes, and I would have suggested it had it not been for the WMI requirement.
"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
|
|
|
|
|
Hi,
I am getting error no 5 while writing in my C Drive which is having windows vista.
What should I do?
I tried with Dismount volume that is working with all drive except c:(OS drive).
What should I do that?
|
|
|
|
|
Error 5 == access denied. Sounds like a permissions thing. I suspect you aren't permitted to write to c:\? The same thing happens when writing to c:\ with a default install of XP as well - it's not necessarily a Vista thing.
|
|
|
|
|
This is only wuth vista becuase I have checked with Xp and all, this problem is with vista only.
|
|
|
|
|
"What should I do?": Reading about Right Managment in Vista.
=> http://msdn.microsoft.com/en-us/library/aa905330.aspx[^]
You cant write a file where you want, you need to have the write rights. A nice place to write is the User Directory who started the writing process.
Greetings from Germany
|
|
|
|
|
Thank you but I have set all security attributes. I am facing the problem only Os drive of Vista.
Is there any way to skip the security permission?
|
|
|
|
|
There is always a way. Your process needs administrative rights. But thats no good practise.
I guess your not so seasoned in Windows programming, so you got to learn a lot.
Once again: You better read and understand the right managment in Vista.
Greetings from Germany
|
|
|
|