|
Thanks Maximilien,
I had tried that.. but it doesnt compile on VS 8.
Any idea, if there is any modified version of the same.
Thanks.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
you can try fixing the error and submit a patch to the author, I'm certain he will be happy that you contributed to his project.
If it's the same for VS8 as it is for VS.net 2003, I think you need to comment out the CStreamOnCString class definition and declaration.
|
|
|
|
|
CoolASL wrote: I require an HTML Control in which i can show the content by passing the html code in string form.
Would it be permissible to save the string to a (temporary) file 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
|
|
|
|
|
David,
Thanks for the reply.
Saving the string to a temp HTML file and then displaying it would be quite cumbersome.
Any other way to directly get the string code to work??
Thanks.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
CoolASL wrote: Saving the string to a temp HTML file and then displaying it would be quite cumbersome.
How so? Saving to a file is 2-3 lines of code. Then you could just use the WebBrowser control. It doesn't get much easier.
"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
|
|
|
|
|
Not sure if this fits your requirements: XHTMLStatic[^]
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
Hmm.. seems to be cool.
I hope it compiles on VS8 !
Thanks a lot.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
|
Hello.
I have created one dialog box on which I have added one button through wizard. I want to set the text from that button to style BOLD.
How can I do that?
Thanks and Regards
Rakesh
|
|
|
|
|
By changing the font on the button. I believe it's a SetFont method, but I could be wrong there.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
There is an example of how to do this to a static control here. Just use a button instead.
"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
|
|
|
|
|
Hello,
I am creating a short-cut to an installed application in the "C:\Program Files (x86)" folder, but the target always seems to point to the "C:\Program Files" folder, the only problem with this is the short-cut icon shown is the default one. But if i double-click the short-cut, the app is invoked fine. Is this a problem with the 64-bit Vista shell or am i doing something wrong in the below mentioned program. My appname is test.exe and is installed in the "C:\\Program Files (x86)\\Sample" folder.
All the folders usedin the below program were valid one's on my system.
This same program works fine on XP-64 bit.
Regards,
HRESULT CreateLink(LPCSTR lpszPathObj, LPCSTR lpszPathLink, LPCSTR lpszDesc, LPCSTR lpszWorkDir) ;
int _tmain(int argc, _TCHAR* argv[])
{
CoInitialize(NULL);
HRESULT ret = CreateLink("C:\\Program Files (x86)\\Sample\\test.exe","c:\\users\\public\\desktop\\test.lnk","Test","C:\\Program Files (x86)\\Sample");
if(SUCCEEDED(ret))
printf("\nCreate link succeeded");
else
printf("\nCreate link failed");
CoUninitialize();
return 0;
}
HRESULT CreateLink(LPCSTR lpszPathObj, LPCSTR lpszPathLink, LPCSTR lpszDesc, LPCSTR lpszWorkDir)
{
HRESULT hres;
IShellLink* psl;
// Get a pointer to the IShellLink interface.
hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
IID_IShellLink, (LPVOID*)&psl);
if (SUCCEEDED(hres))
{
printf("\nSucceded in creating an instance");
IPersistFile* ppf;
// Set the path to the shortcut target and add the description.
psl->SetPath(lpszPathObj);
psl->SetDescription(lpszDesc);
psl->SetWorkingDirectory(lpszWorkDir);
//psl->SetIconLocation(lpszWorkDir, 0);
// Query IShellLink for the IPersistFile interface for saving the
// shortcut in persistent storage.
hres = psl->QueryInterface(IID_IPersistFile, (LPVOID*)&ppf);
if (SUCCEEDED(hres))
{
WCHAR wsz[MAX_PATH];
printf("\nSucceded in querying interface");
// Ensure that the string is Unicode.
if(MultiByteToWideChar(CP_ACP, 0, lpszPathLink, -1, wsz, MAX_PATH))
{
// TODO: Check return value from MultiByteWideChar to ensure success.
printf("\nSucceded in conversion");
char pszGetPath[MAX_PATH];
if(SUCCEEDED(psl->GetPath(pszGetPath,MAX_PATH,NULL,SLGP_RAWPATH)))
printf("\nGet Path: %s",pszGetPath);
else
printf("\nGet Path failed");
// Save the link by calling IPersistFile::Save.
hres = ppf->Save(wsz, TRUE);
}
ppf->Release();
}
psl->Release();
}
return hres;
}
Regards,
Pavan
|
|
|
|
|
kpkrind wrote: HRESULT ret = CreateLink("C:\\Program Files (x86)\\Sample\\test.exe","c:\\users\\public\\desktop\\test.lnk","Test","C:\\Program Files (x86)\\Sample");
I might be wrong, but isn't this the old problem with path names containing spaces in a command line?
Try to surround (at least) the paths containing spaces with quotes.
Like this:
CreateLink("\"C:\\Program Files (x86)\\Sample\\test.exe\"","c:\\users\\public\\desktop\\test.lnk","Test","\"C:\\Program Files (x86)\\Sample\"");
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
No, its not a problem with the spaces, CreateLink expects a string pointer and is passed correctly
|
|
|
|
|
OK, It was worth a try anyway.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Hi
Iam developing a Dialog based application.
In that application user has to add some files to perfrom the next operation,
so i need to validate the file path,file name,for further operation.
how can i check that user has entered the correct path,file name
|
|
|
|
|
reddy harish wrote: how can i check that user has entered the correct path,file name
It depends of what you mean by that exactly. If you simply want to check if the file exist, you can simply try to open is (with fopen for example) and if the function succeed, then the file exists. Supply the absolute path so that you can check the path and the file name.
|
|
|
|
|
Thnks for ur reply.
but If the user is entering the wrong file path or file name and he is trying to perform the next operation,how can we prevent him from that.so that we have to write the code to give him messeage or to stop him.
Ex:when we are entering the wrong file name or path in the "RUN" command,it shows us a warning or message saying that is not exist.
Like that can we perform the operation
|
|
|
|
|
Uuuhh ??
Did you read my post ?
If you try to open a file that doesn't exist in read mode, fopen will return an error. So in that case you know that the file is wrong and you can display a message and not continue to the next step.
Anyway, the solution of Christian is better (and you provide also an elegant way to choose the file for the user).
|
|
|
|
|
Easiest way - get them to select files with the file dialog and set the style so the filename entered must exist.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
See Cedric Moonen answer.... and see SetCurrentDirectory(...) and see return value.Is your purpose
|
|
|
|
|
|
Christian's solution will work for the most part. I'd just add that after you select a file, use CFile::GetStatus to determine if it exists or not. The method will return TRUE if it succeeds, and FALSE if the file/directory doesn't exist.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hello,
I am writing a function that control the staus from key pressed.
It works but how can check in one function at the same time if VK_CONTROL && VK_SHIFT are pressed !
Thank you !
AutreChien
|
|
|
|
|
NorGUI wrote: VK_CONTROL && VK_SHIFT are pressed
SHORT GetKeyState(int nVirtKey);
Return Value:
If the high-order bit is 1, the key is down; otherwise, it is up.
nVirtKey:
VK_LSHIFT
VK_RSHIFT
VK_LCONTROL // Check this parameter
VK_RCONTROL // or Check this parameter with GetKeyState in Key press event
VK_LMENU
VK_RMENU
Example:
if(GetKeyState (VK_LSHIFT) && GetKeyState (VK_LCONTROL))
{
// Do something the left shift and control key are pressed.
}
-- modified at 6:52 Tuesday 22nd August, 2006
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|