|
a BSTR is a UTF-16 (or is it UCS2? can't remember) encoded string. This means that each character is a 2 byte word. The ASCII character set fits within a single byte of each word. As such, from a char* point of view, a BSTR is basically a string with a \0 character between every character. Hence you get only the first character.
|
|
|
|
|
%S will work as long as you are calling an ANSI trace function. %S means "a string in the character set opposite of the current TCHAR character set". To make it work in all cases, use %ls instead.
|
|
|
|
|
Anders Gustafsson wrote: Where Name is a BSTR:
TRACE("\nFIELD[%d]: %s",j,(LPCTSTR)Name);
TRACE("\nFIELD[%d]: %s",j,(LPCTSTR)_bstr_t(Name));
|
|
|
|
|
Hi All.
Can anyone tell me how to change a text in an edit box of an other process programmatically (maybe using SetWindowsHook or something else) I want it to work on Win9x and WinXP
thanks
|
|
|
|
|
SendMessage(....)
led mike
|
|
|
|
|
See if its helpfuls
char *MY="Hello";
HWND hWnd = ::FindWindow("Notepad", NULL);
CWnd *hWndEdit=FindWindowEx(hWnd,NULL,"Edit",NULL);
::SendMessage(hWndEdit->m_hWnd,WM_SETTEXT,0,(long)MY);
|
|
|
|
|
// CEdit m_edit;
m_edit.SetWindowText ("your text");
|
|
|
|
|
He said on the other program not his program
|
|
|
|
|
lucy wrote:
m_edit.SetWindowText ("your text");
but for that you have get handle of that Edit Box
|
|
|
|
|
NOTE: I am posting this message here because i dont have access to suggestion forum as i lost my email account password and for that you need to be able to log on to your mail id. So kindly accept this letter and try not to go against my appeal. If you are not agree with whatever i said and you want me to change my opinion then please email me at crook_martin2000@yahoo.co.uk and do not reply to this post here.
I apologise for any inconvenience caused to other users of this mind blowing site.
Thanks for your support.
Dear Author,
I appreciate all the efforts you took to get this site up and running but i dont like the way you have developed the forum section.
when anyone who replies to any post, then that post should come up on the top whereas new messages keep on adding and the old message goes back to 3-4 pages and most of us dont even care to look more then 2-3 pages back.
For instance look at this forum site,
http://www.nabble.com/port-xen-f12400.html
How beautifully they have managed it without making it a mess, whereas this site forum just looks a big mess.
Please take steps to change the design of this forum as we all need this great forum but would appreciate its proper use.
Thanks and Regards
Programmer
|
|
|
|
|
Software_Specialist wrote: most of us dont even care to look more then 2-3 pages back.
Yup we never get stuck up with the history
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
hey tell me,
we both know together, don't we ?
oh, and for those who missed This one[^], fire is opened guyz
|
|
|
|
|
|
|
WhiteSky wrote: What was your question?
don't even ask !
|
|
|
|
|
Software_Specialist wrote:
WTF......lol
who the helll you are!
|
|
|
|
|
|
|
Hi there!
We've got a real big problem, allthough it seems to be not really difficult:
Our main application is a dialog which definitely MUST remain a dialog.
My colleague wants to create a SDI window from this dialog by clicking on a specific button.
Still no problem.
The problem ist, that the window seems not to get the windows messages:
Usually if you create a method to handle a mouseclick on a button in the toolbar, you can also create a function
OnUpdateClickXXX(CCmdUI* pCmdUI)
for example you could gray a specific button, if ButtonXXX is being clicked on.
But OnUpdateClickXXX is never called!
For me it seems, that the WM_PAINT message is being processed just by the dialog.
the SDI window is created with
CSingleDocTemplate* pDocTemplate;<br />
pDocTemplate = new CSingleDocTemplate(<br />
IDR_MAINFRAME,<br />
RUNTIME_CLASS(CSDI_LeerDoc),<br />
RUNTIME_CLASS(CMainFrame), <br />
RUNTIME_CLASS(CSDI_LeerView));<br />
AfxGetApp()->AddDocTemplate(pDocTemplate);
when you click on a button in the dialog.
All OnClickBlah, OnUpdateBlah... methods are inserted by the class wizard, and the AFX_MESSAGE_MAP
has the correct ON_COMMAND, ON_UPDATE_COMMAND...entries
Could you give us some hints, where we could look for that problem?
Sure, the problem is caused by the dialog "standing" between the application and the doc/view.
Thank you all, and i hope you can help us with our problem.
Sascha Billian
Sascha Billian
|
|
|
|
|
Huh?
Does the "SDI window" ever show? You haven't shown any code that creates a window.
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Yes, the window appears.
I haven't the code here, because i'm at home, but the window shows as it should.
but there's one thing i forgot to tell you.
The problem problem occured, when we tried to gray out a button in the toolbar by clicking on another toolbar button. It didn't gray out.
BUT:
in the menu bar, if i try the same with the menu items which are linked with the buttons (same id), one item is grayed out when clicking the other:
this is the code which is used to create the doc/view and show the window:
CSingleDocTemplate* pDocTemplate;<br />
pDocTemplate = new CSingleDocTemplate(<br />
IDR_MAINFRAME,<br />
RUNTIME_CLASS(CSDI_LeerDoc),<br />
RUNTIME_CLASS(CMainFrame), <br />
RUNTIME_CLASS(CSDI_LeerView));<br />
AddDocTemplate(pDocTemplate);<br />
<br />
CCommandLineInfo cmdInfo;<br />
ParseCommandLine(cmdInfo);<br />
<br />
if (!ProcessShellCommand(cmdInfo))<br />
return FALSE;<br />
<br />
m_pMainWnd->ShowWindow(SW_SHOW);<br />
m_pMainWnd->UpdateWindow();<br />
...
thanks!
Sascha
|
|
|
|
|
I'm lost. Is the probem with disalng a button or with window creation?
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
sascha.billian wrote: Sure, the problem is caused by the dialog "standing" between the application and the doc/view.
And you "know" this because you developed the document/frame/view classes in a normal SDI application where it all works as expected but when you share the source code files into your dialog based application it behaves differently... correct?
led mike
|
|
|
|
|
correct.
any clues?
thanks
Sascha
|
|
|
|
|
sascha.billian wrote: any clues?
My guess would be that the command routing is not initialized. Put Spy++ on your dialog and then envoke an action in your frame window and see if it shows up in the dialog messages. If it does you might be able to override OnCmdMsg in the dialog and forward the message to the frame window.
led mike
|
|
|
|