|
Only at runtime, anytime after the Windows object (HWND) is created.
In response to the WM_INITDIALOG message is a good place
Mark
|
|
|
|
|
And...you'll want to do that AFTER you add items to the combobox!
Mark
|
|
|
|
|
I got it.....its working.....Thanks a bunch.
C++Prog
|
|
|
|
|
Here comes another thing...I need to do it dynamically. SetCurSel will make it static.
Thanks again
C++Prog
|
|
|
|
|
Preeti9 wrote: I need to do it dynamically. SetCurSel will make it static.
How so? It should just select/highlight the string, scrolling it into view if necessary.
|
|
|
|
|
o okay...I got it....
Thanks
C++Prog
|
|
|
|
|
|
I`m trying to write SDI MFC application with view class CRichEditCtrl. In my CMyAppView I used GetRichEditCtrl() to access the main RichEditCtrl. Now I want to create an independent class to write to RichEditCtrl lets call it CTextEditor.
What I don`t understand is how to tell the class to find CRichEditCtrl as I`m not able to use GetRichEditCtrl() outside the CMyApp class. I`ve tried to do something like:
<br />
int CTextEditor::WriteText(CRichEditCtrl *wnd,CString str,CHARFORMAT cf)<br />
{<br />
int nOldLines = 0, nNewLines = 0, nScroll = 0;<br />
long nInsertionPoint = 0;<br />
nOldLines = wnd->GetLineCount();<br />
nInsertionPoint = wnd->GetWindowTextLength();<br />
wnd->SetSel(nInsertionPoint, -1);<br />
wnd->SetSelectionCharFormat(cf);<br />
wnd->ReplaceSel(str);<br />
nNewLines = wnd->GetLineCount();<br />
nScroll = nNewLines - nOldLines;<br />
wnd->LineScroll(nScroll);<br />
return 0;<br />
} <br />
And then call it from CMyapView like this:
<br />
CHARFORMAT cf;<br />
cf.dwEffects = CFE_BOLD;<br />
cf.dwMask = CFM_BOLD;<br />
cf.cbSize = sizeof(CHARFORMAT);<br />
CTextEditor editor;<br />
editor.WriteText(&GetRichEditCtrl(),"Mytext",cf); <br />
But I get the unresolved externals error..
What am I doing wrong?
Please help - no clue bout how to use pointers...
|
|
|
|
|
Can you paste error text ?
|
|
|
|
|
Here`s what the build log says...
TestAppView.obj : error LNK2019: unresolved external symbol "public: int __thiscall CTextEditor::WriteText(class CRichEditCtrl *,class ATL::CStringT<char,class strtraitmfc_dll<char,class="" atl::chtraitscrt<char=""> > >,struct _charformat)" (?WriteText@CTextEditor@@QAEHPAVCRichEditCtrl@@V?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@U_charformat@@@Z) referenced in function "public: void __thiscall CTestAppView::OnPortOpen(void)" (?OnPortOpen@CTestAppView@@QAEXXZ)
C:\Documents and Settings\Raivo\My Documents\Visual Studio 2005\Projects\TestApp\Debug\TestApp.exe : fatal error LNK1120: 1 unresolved externals
|
|
|
|
|
It seems like, somehow CTextEditor class definition is not included in project. Just curious to know, whether you have added cpp containing CTextEditor in to your project.
Because, from error text, its seems so.
|
|
|
|
|
|
HakunaMatada wrote: Can anyone give me pointers on creating an Application without any UI?
If you hand me one of those beers I'll give you a pointer
The very simplest way would be to not show your app's main window.
Thanks for the beer
Mark
|
|
|
|
|
Mark Salsbery wrote: The very simplest way would be to not show your app's main window.
I know we can just hide the main Window but I was looking at a more elegant solution.
Mark Salsbery wrote: Thanks for the beer
You are welcome.
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
It’s rather simple to write an unmanaged C++ application that crashes when it performs a callback. It’s impossible to write a managed application that does the same, thanks to delegates. - Jeff Prosise
|
|
|
|
|
HakunaMatada wrote: but I was looking at a more elegant solution.
Console app with hidden console window.
A service application (but has to be run from the service manager).
What if you make a Win32 app and never create a window?
|
|
|
|
|
Mark Salsbery wrote: What if you make a Win32 app and never create a window?
I did try this and it seems to work. I created a message loop but didn't create any window. Would this affect the application in any way?
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
It’s rather simple to write an unmanaged C++ application that crashes when it performs a callback. It’s impossible to write a managed application that does the same, thanks to delegates. - Jeff Prosise
|
|
|
|
|
I would think if it runs it's fine
As long as there's a way to terminate the process it shouldn't matter.
Windows service applications run just fine with absolutely NO UI. The only difference is the
added entry points so the SCM can control them.
You may not even need a message loop.
Mark
|
|
|
|
|
Have you tried to do this from a Win32 based console app?
Chris Meech
I am Canadian. [heard in a local bar]
I agree with you that my argument is useless. [Red Stateler]
Hey, I am part of a special bread, we are called smart people [Captain See Sharp]
The zen of the soapbox is hard to attain...[Jörgen Sigvardsson]
I wish I could remember what it was like to only have a short term memory.[David Kentley]
|
|
|
|
|
HakunaMatada wrote: Can anyone give me pointers on creating an Application without any UI?
I think that's not allowed on Windows.
|
|
|
|
|
how to ping remote system running on Windows 2000 using WMI
is there any patch for windows 2000 to ping remote system using win32_pingstatus class
thanks
abhi
|
|
|
|
|
|
I am trying to write an app that will play a movie and allow me to draw on top of it. I have gotten to the point where I can play the movie and using CCLientDC I can draw lines and shapes on the window while the movie is paused. My problem is that as soon as I start the play back of the movie again everything that I jsut drew dissappears. I tried saving all the info about the lines and then in the OnDraw function redrawing them everytime the movie needs to be refreshed but that doesn't seem to work. Does anyone have any suggestions on how to do this?
My environment is VC++ 6.0
thanks,
Mike
|
|
|
|
|
barrem wrote: allow me to draw on top of it
You can't use the same window since the movie playing is drawin in that one. You would have to create another window on top of (Z order) the one the movie is drawing to and draw into the new window.
led mike
|
|
|
|
|
An alternative is, if you have control over the video renderer (you have access to each frame
of video before it gets blted to the window) then you can draw stored shapes offscreen on the
video frame and then blt it. This makes it nicely flicker-free as well.
|
|
|
|
|
Does anyone know why the syntax for exporting constants in a DLL is different from exporting variables or functions?
Take the following code snippet for instance:
extern "C"
{
extern const IID IID_IX =
{0x32bb8320, 0xb41b, 0x11cf, {0xa6, 0xbb, 0x00, 0x80, 0xc7, 0xb2, 0xd6, 0x82}};
}
Why do the extern statements need to be nested?
|
|
|
|