|
uday kiran janaswamy wrote: want to Handle the RButtonDown Event for every Dyanmically Created Edit Box
Refer ON_COMMAND_RANGE[^] macro..
Do your Duty and Don't expect the Result
|
|
|
|
|
hi appu,
The Function ON_COMMAND_RANGE(id1, id2, memberFxn )
Which is only the Command Range.
this used to specify the idientifier1 to indentifiern a Member Function.
But my doubt when ever i click the mouse lbutton then i will create a EditBox.
When I click the RButton of the Created EditBox then a Menu must be Populated.
please give me correct solution.
Uday kiran
|
|
|
|
|
Since you are dynamically creating Buttons you cant have specific handlers for each button...
uday kiran janaswamy wrote: ON_COMMAND_RANGE(id1, id2, memberFxn )
Have one variable which hold the next ID of the button, keep incrementing the variable after creating each button ..
say 100 is the ID of the first button then ..
ON_COMMAND_RANGE(100, 200, Fnc)
This will notify the wm_command to the Fnc with the button ID ranges from 100 to 200..
But the RClick in button i didn't try yet.. i hope to catch the RClick you have to write your own custom button..
or handle the RClick on the parent Dialog or View and try to get the button from the current cursor position (but i don't know exactly if the RClick will be passed to its parent)
Do your Duty and Don't expect the Result
|
|
|
|
|
uday kiran janaswamy wrote: CEdit *ptr = new CEdit;
ptr->Create(WS_VISIBLE|WS_CHILD|WS_BORDER|WS_TABSTOP|ES_AUTOHSCROLL,CRect(point.x,point.y,point.x +100, point.y +20),this,NULL);
Last parameter here, you can assign unique control Id, lets say 100.
you can use it to handle notifications using that like
ON_EN_SETFOCUS(100, OnSetfocusEdit1)
I'm not sure about other notification messages. But this would give you a hint.
|
|
|
|
|
Hi I am developing a dialog based application.
I require an HTML Control in which i can show the content by passing the html code in string form.
I searched and found one, but it doesnt compile on Visual Studio 8.
Can anyone point me to any such existing application here.
Thanks in advance.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
Search for the excellent "SimpleBrowser" here on CP.
|
|
|
|
|
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).
|
|
|
|