|
CMyFormview is a View in my dll.it is derived from CFormView.Why it does not respond to on_keydown message,also it does not respond to the overrided function PreTranslateMsg .
gucy
|
|
|
|
|
Hello all
I'm writing an application which needs to have name of application which is using serial port. Can any one tell me how to retrieve application name which is using serial port.
Thanks for your help.
Hari
|
|
|
|
|
I can't give you a better guide than to point you in the direction of HandleEx on www.sysinternals.com[^].
Iain.
|
|
|
|
|
How can I execute a function in the context of another thread?
I know about APCs, but these require that the target thread becomes alertable at some point in time. I can not (or do not want to) change the source to the other thread to call SleepEx(0) every so often.
Kernel-mode APCs are ideal for this, because the thread does not need to be alertable. However, it seems like they can only be used by ring 0 apps, and are platform-specific.
Is what I want to do even possible?
|
|
|
|
|
If the thread is a UI thread, use PostThreadMessage() and pass it a registered message, or a WM_APP+n value. You'll need to arrange some communication to have the sending thread wait until the second thread has finished.
--Mike--
"Big handwavy generalizations made from a position of deep ignorance is one of the biggest wastes of time on the net today.
-- Joel Spolsky
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
Yes, I thought of that. The only problem there is that I want this to work for any thread, whether it has a message loop or not.
|
|
|
|
|
In that case, you want fibers. They are like threads but you control the scheduling of when they run. Start by reading the docs on ConvertThreadToFiber()
--Mike--
"Big handwavy generalizations made from a position of deep ignorance is one of the biggest wastes of time on the net today.
-- Joel Spolsky
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
I'm creating a map editor for a game engine i've been working on. I'm hoping to create the interface in a similar fashion to photoshop. Basically, I have my MDI setup... and i'm creating and displaying small WS_EX_TOOLWINDOW'd dialogs, which will contain information and interaction tools for level editing. But, I'm having a couple problems.
Main Question:
In photoshop, when you click one of the palette windows, focus is not taken from the document. How can I do the same thing? As soon as I click on of my tool windows, no CDocument is active.
Secondary Question:
Also, I can get the small windows to show on top of the application (TOPMOST), and when the app is minimized, i hide the tool windows. But, if I put my app behind others, the tool windows are on top of EVERY window. I only want them on top of MY application, not every running window of every app.
Extra Question:
Also, is there a graceful way to detect when the active document has changed? An event handler, perhaps?
|
|
|
|
|
I keep getting the following error upon linking:
"error LNK2001: unresolved external symbol "public: class CString __thiscall CMyDoc::FKeyReset(int)"
This happens when I try to instantiate a function template. The code snippets are below. Does any one spot an obvious problem in it? Thanks,
Ralf.
MyDoc.h:
template<class t=""> CString FKeyReset(T RecSet);
MyDoc.cpp
template<class t=""> CString FKeyReset(T RecSet) {
CString str;
if(T > 0)
str.Format("message 1");
else
str.Format("message 2");
return str;
}
Elsewhere outside MyDoc:
CMyDoc *pMyDoc = (CFisheriesDoc *) //pointer to MyDoc
((CFrameWnd*) AfxGetApp()->m_pMainWnd)->GetActiveDocument();
CString szAstr;
int i = 2;
szAstr = pMyDoc ->FKeyReset(i); //offending line
ralf.riedel@usm.edu
|
|
|
|
|
|
I'm creating one of the biggest project I have undertaken N I'm a newbie, so I need lots of help. Because it's so big, I break it down into multiple parts (multiple projects, 1 DSP for 1 DSW), which I call utilities.
Now I want to use a "Utility", eg MyCustomStringCls, in another project. I have compiled N tested the "utility" so I have the OBJ file already.
Now here are my Q:
1. When I want to use an utility (eg MyCustomStringCls), in VC++, do I need to "Add To Project > Files" the MyCustomStringCls.h and the .CPP?
2. I want to call include with Angle bracket instead of DoubleQuote, do I just need to "Settings > C/C++ tab > Preprocessor" and add the path to "Additional Include directories" ?
I have done this, but everytime I add new method, which returns MyCustomStringCls object, in my new class, VC++ always add new #include with double quote. I'm fighting with it by manually delete that new include.
eg. For the new class, I want to have:
#include <mycustomstringcls.h>
BUT, VC++ always add this:
#include "..\Prj_MyCustomStringCls\MyCustomStringCls.h"
3. Every time I compile my new Project, it creates the MyCustomStringCls.OBJ and puts it in my new project folder. How do I tell VC++ compiler to skip creating OBJ for particular .H .CPP? And how do I tell linker to use the OBJ from MyCustomStringCls project folder?
Hope I don't confuse anybody. Please Help.
cheers,
Jo
|
|
|
|
|
consider creating LIB files for stuff you want to reuse.
A "lib" (library) is just a single file that contains one or more OBJ files. They are packaged into a single lib file, the linker can selectively pull obj files that are needed into your other projects....
To link this lib into other projects -- you'll need to update the settings on your project to generate a lib for a set of files. And also you'll need to create one or more H files to include in those other projects....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
Peter,
I have never made LIB file. I'm reading the VC++ help on creating LIB, but I'm kinda of lost. Can you give me more pointer on how to do it, please?
cheers,
Jo
|
|
|
|
|
The only way I ever do it, is in the new project wizard. You'll have to do it that way. The process is mostly: compile c/cpp files to .objs, and the "librarian" combines those into a lib file.
Start at File|NewProject and look for a ".lib" type thingy in there.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
When you do VC++ DLL project.
The outcome will be a *.dll and a *.lib. The VC++ will automatically do it for you. If you are using Borland C++. You could specify to create a LIB project.
Basically, to use you lib. You just link it using you project configuration or do it in the code. And also, to include your *.h file (your header file)
hope this helps.
|
|
|
|
|
Thanx guys,
Following you guys' suggestion, I have successfully created .LIB(use VC++ Static DLL Project) and used it in my other project.
After understanding the procedure, it's actually extremely simple.
Jo
|
|
|
|
|
Hi all,
i am using MFC, i've created a Tree ctrl with the check boxes style.
how do i disable the checkboxes from the root item (the rest item should have it , but root should not)???
can any1 help?
thanks
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
For each node(Tree item) u need to set the style !
|
|
|
|
|
what do u mean? can u give an example?
|
|
|
|
|
Hello all
I want to write an application in which I would like to include context sensitive tooltip help messages. If I drag question mark symbol on a particular area, it has showup some tooltip help message.
If anyone knows how to do it, please help me.
Thanks for your help
Hari.
|
|
|
|
|
Hi
I’m trying to write a program that connects to AutoCAD 2002. I know that automation works with VARIANT data types. Also I found two nice MFC classes ‘COleVariant’ and ‘COleSafeArray’ to work with variants, but I could not find any class with an ‘operator []’ function that can access to elements of a variable of VARINAT type that has VT_ARRAY flag.
However if you have written some codes with VBA, you know that in VBA, with some simple codes like this you can access to elements of VARIANT:
Dim var As VARIANT
set var = MyAutoCADFunction ( … )
var(0) = 1
var(1) = 5
Do you know any predefined class in C++ to access this magic data type?
Thanks for your help
Babak Z.
|
|
|
|
|
Well, its not that bad yet, but its getting close.
Anyone ever make a SDI app with a Word.Document object as the Single Document and then try to open a new or existing doc in that same Document/View? It keeps telling me the document is already opened and locked for editing then I get an exception in malloc.c. If I open the document initially, its fine. Only when I try to open one the second time do I have problems.
Does anyone have any example code? I've gotten a lot of the code from the XOffice article here on CP, but its an MDI app.
I haven't worked with the Doc/View framework much either. Know where I can find more info on working with Documents in Doc/View?
Thanks!
Jason Henderson I bleed orange.
|
|
|
|
|
Hi,
Can I change the color of a single line in a list box ?
I have a list box that display a short list of lines and I want to color one of them in red, how do I do it ?
Shay
|
|
|
|
|
there are some good aricles about "UserDraw" ListControls here.
|
|
|
|
|
Yes but this is for list control, I have a listbox.
Any idea.
|
|
|
|