|
DavidCrow wrote: Actually they are not even necessary since the \Windows\System32 folder is part of the search path.
Yeah, that's what I figured, except removing the absolute path from the code I already had wouldn't work. Just now it dawned on me - why bother to use explorer.exe to open up something that will run from the command line?
So, I just tried this code & found it do do the job:
ShellExecute(NULL, "open", "diskmgmt.msc", NULL, NULL, SW_SHOWNORMAL);
It also has the addd benefit of doing away with the "File download - Security Warning" dialog box that appears when using the code I presented in a previous post.
Much thanks David.
|
|
|
|
|
Hi!
When I run a VC++ 8.0 application, I got an error which states,
"The procedure entry point ??0?$basic_istream@DU?$char_traits@D@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z could not be located in the dynamic link library MSVCP80.dll."
What might be the cause of this error? How do I resolve this error?
|
|
|
|
|
Do you get this error on the development machine? If not, have you got the VC Redistributables installed on the target machine?
|
|
|
|
|
Hi!
Not on the Development machine. But I've installed the VC Redistributables on my machine.
|
|
|
|
|
I suspect the CRT version your program uses is different from that is available on the target machine. If you've installed the redist, then I don't see why this should happen.
OK, see this link: The next level of DLL hell - SxS[^]
|
|
|
|
|
Could u please tell me how to find out which version of the CRT my program is using?
|
|
|
|
|
if you have sourcecode of application, just open itr manifest file. it contain all the information you needed
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Rajesh R Subramanian wrote: OK, see this link: The next level of DLL hell - SxS[^]
DLL Helllllllllllll!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
The good old DLL hell used to be a lot straight forward. But this is *real* hell.
|
|
|
|
|
Hi Experts,
I am using CFileFind class to get the information of folder (size, files, folders).This is working fine with all folders but not with one system folder named "System Volume Information".
Could you tell me what is wrong with it?
|
|
|
|
|
|
Thank you for reply but how can I do this programtically?
|
|
|
|
|
|
Hi all,
I m using CFileDialog class for file saving like this.
CFileDialog avi(FALSE,NULL,NULL,OFN_CREATEPROMPT|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,_T("Backup File|*.BKP|"), this,0);
i want when i select a file for saving the extension is alwaz .BKP
Please tell me how can i do this.
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
|
|
|
|
|
"_$h@nky_" wrote: CFileDialog avi(FALSE,NULL,NULL,OFN_CREATEPROMPT|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,_T("Backup File|*.BKP|"), this,0);
the CFileDialog just return you the path,yuo could write rest of logic after user press ok on the CFileDialog box window!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Please tell me how can do this.
Please tell me with example.
Thanks.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Pseudo code:-
1. FileDialogObject.GetFileName() return you the file path, where you save you file.
2. check for existence of your extension, if it there, leave it otherwise add it to the filename.
3. write code for saving of file.
remember cfiledialog doesn't save file for you, you have to write code for it.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Try changing your second parameter:
CFileDialog avi(FALSE,_T("bkp"),NULL,OFN_CREATEPROMPT|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,_T("Backup File|*.BKP|"), this,0);
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Hi,
How to write a BYTE array into a file and reading it back from. I used fwrite and fread but it is not working.
Regards,
|
|
|
|
|
subramanyeswari wrote: I used fwrite and fread but it is not working.
It should.
Please, when you have a problem like describe exactly what you did so that we can check it. Post some code how you open the file and read/write in it.
|
|
|
|
|
Here is the code
char strPasswd[8] = "test123";
DWORD dlen = 8;
size_t t ;
long lSize;
size_t result;
BYTE* Newpasswd;
FILE *fp = fopen("c:\\test.bin", "wb+");
BYTE* encodedpasswd = EncodeString(strPasswd,&dlen);
t = fwrite((unsigned char*)encodedpasswd,1,sizeof((unsigned char*)encodedpasswd),fp);
fclose(fp);
fp = fopen("c:\\test.bin", "rb+");
fseek (fp , 0 , SEEK_END);
lSize = ftell (fp);
rewind (fp);
Newpasswd= (unsigned char*) malloc (sizeof(unsigned char)*lSize);
int i = fread(Newpasswd,1,sizeof(Newpasswd),fp);
char* tempPassword = DecodeString(testpasswd,&dlen);
Is writing is not done properly?
Regards,
|
|
|
|
|
I guess the problem is because you are using sizeof to calculate the lenght of your string. Sizeof will return the size (in bytes) of the pointer, not what it contains. So replace the first sizeof by a strlen (if the string is NULL terminated).
The others sizeof (in the malloc and in the fread) should be replaced by the size of the data that is retrieved from the file.
|
|
|
|
|
subramanyeswari wrote: I used fwrite and fread but it is not working.
(Un)fortunately It doesn't depend on fwrite and fread , my friend.
The following works for me (error checking left as exercise)
int main()
{
{
BYTE bValue[]={2,4,8};
int iLen = sizeof(bValue)/sizeof(bValue[0]);
FILE * fpo = fopen("foo.bin", "wb");
fwrite(&iLen, sizeof(iLen), 1,fpo);
fwrite(bValue, sizeof(bValue), 1, fpo);
fclose(fpo);
}
{
BYTE * bValue;
FILE * fpi = fopen("foo.bin", "rb");
int iLen;
fread(&iLen, sizeof(iLen), 1,fpi);
bValue = new BYTE[iLen];
fread(bValue, sizeof(BYTE), iLen, fpi);
fclose(fpi);
delete [] bValue;
}
return 0;
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all,
I am working on a dialog box application...
i want to disable the cross button on top right corner on a particular condition and at other situations it may work.....
How can i do this?
thanks in advance
|
|
|
|
|
You can disable the button using the code shown below
BOOL bEnable = FALSE;
UINT menuf = bEnable ? (MF_BYCOMMAND) : (MF_BYCOMMAND | MF_GRAYED | MF_DISABLED);
CMenu* pSM = GetSystemMenu(FALSE);
if(pSM)
{
pSM->EnableMenuItem(SC_CLOSE, menuf);
}
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|