|
I don't know if this will be much help but you might look at using COM. I had to incorporate MS Word into an application and put a special button on the Word toolbar. It isn't easy if you are a beginner but it is possible. There are several good examples out there, Amit Dey has one that is really good. If you haven't already looked around, you might start by looking here:
http://www.codeproject.com/com/#Automation
If all depends on how much you know and how much you want to know....
|
|
|
|
|
Hi There,
I have a class derrived from a CComboBox class, and I really need to recieve notification - SelEndOK for example, but from what I can make out messages are transmitted to the parent window, and a derrived class doesn't recieve the any kind of notification. Is there any way to recieve get these messages?
Any help would be much appreciated...
With time we live, with money we spend!
Joel Holdsworth.
|
|
|
|
|
Use the ON_CONTROL_REFLECT macro in your message map to handle the notifications in the CComboBox -derived class.
--Mike--
If it doesn't move and it should: WD-40. If it moves and it shouldn't: duct tape.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Heyo, (english version ... when u can call it is attached as reply)
Ich versuche im Moment in einer EXE-Datei einen Import zu verändern, dass klappt ganz gut und wunderbar, wenn diese Funktion aus der EXE-Datei heraus aufgerufen wird.
Sobald ich dies aber bei einer anderen EXE-Datei machen möchte, bei der ich in den Prozess eingeschleust werde - über ein WH_CBT - funktioniert dies jedoch nicht, da die DLLs zu diesem Zeitpunkt noch nicht initialisiert wurden.
Da bereits in der win_main der veränderte Import benutzt werden soll kann ich auf keine anderen Hooks zurückgreifen.
Weis jemand wie ich An die Initialisierte Importtable komme, bevor diese benutzt wird ?
Vielen Dank schonmal
Also, ich setze einen CBT Hook:
(innerhalb der DLL die in den Zielprocess reinmuss)
<br />
LRESULT CALLBACK CBTProc(int nCode,WPARAM wParam,LPARAM lParam) {<br />
return CallNextHookEx(CBThook,nCode,wParam,lParam) ;<br />
} ;<br />
<br />
void WINAPI InstallNCT(void) {<br />
GWMhook = SetWindowsHookEx(WH_CBT,&CBTProc,GetModuleHandle("MYDLL.dll"),NULL );<br />
} ;<br />
Dieser Code wird mit der ProzessID des Launchers ausgeführt. Sobald ein neuer Prozess erstellt/aktiviert ist wird der folgende Code durchgeführt:
<br />
BOOL APIENTRY DllMain( HANDLE hModule, <br />
DWORD ul_reason_for_call, <br />
LPVOID lpReserved<br />
)<br />
{<br />
switch (ul_reason_for_call)<br />
{<br />
case DLL_PROCESS_ATTACH:<br />
if (isZielProzess()) {<br />
HMODULE thismod = GetModuleHandle("MYDLL.dll") ;<br />
LPVOID addr = GetProcAddress(thismod,"MyOverrideFunction") ;<br />
ChangeImport_("D3DDrv.dll","DDRAW.dll","FunctionName",addr) ;<br />
} ;<br />
return TRUE ;<br />
case DLL_THREAD_ATTACH:<br />
case DLL_THREAD_DETACH:<br />
case DLL_PROCESS_DETACH:<br />
break;<br />
}<br />
return TRUE;<br />
} ;<br />
Wobei ChangeImport_(ModulName,ImportModulName,ImportFunctionName,Addresse) ;
in der MudulName.dll den Import aus der ImportModulName.Dll mit dem Namen ImportFunctionName mit der Addresse überschreibt.
Nun funzt das nicht, da die D3DDrv nich initialisiert ist... aber ich brauchs funzent
|
|
|
|
|
In English:
I want to modify import locations. Therefor i CBT hook 'em and change them at the DLL_PROCESS_ATTACH.
But this doesnt work and because the dlls are not yet initialized when i want to modify.
(see code above)
How can i change the imports form other prozesses ?
Thx in advance.
|
|
|
|
|
|
This might do it, but I haven't tried it.
<code>LONG RegQueryInfoKey(
HKEY hKey,
LPTSTR lpClass,
LPDWORD lpcClass,
LPDWORD lpReserved,
LPDWORD lpcSubKeys,
LPDWORD lpcMaxSubKeyLen,
LPDWORD lpcMaxClassLen,
LPDWORD lpcValues,
LPDWORD lpcMaxValueNameLen,
LPDWORD lpcMaxValueLen,
LPDWORD lpcbSecurityDescriptor,
PFILETIME lpftLastWriteTime
);</code>
Jason Henderson start page ; articles
henderson is coming
henderson is an opponent's worst nightmare
* googlism *
|
|
|
|
|
|
|
I want to test one of M$ examples,"Starting an Interactive Client Process".At the begining of it,there is these lines:
#define DESKTOP_ALL (DESKTOP_READOBJECTS | DESKTOP_CREATEWINDOW | \ DESKTOP_CREATEMENU | DESKTOP_HOOKCONTROL | \ DESKTOP_JOURNALRECORD | DESKTOP_JOURNALPLAYBACK | \ DESKTOP_ENUMERATE | DESKTOP_WRITEOBJECTS | \ DESKTOP_SWITCHDESKTOP | STANDARD_RIGHTS_REQUIRED)
#define WINSTA_ALL (WINSTA_ENUMDESKTOPS | WINSTA_READATTRIBUTES | \WINSTA_ACCESSCLIPBOARD | WINSTA_CREATEDESKTOP | \ WINSTA_WRITEATTRIBUTES | WINSTA_ACCESSGLOBALATOMS | \ WINSTA_EXITWINDOWS | WINSTA_ENUMERATE | \ WINSTA_READSCREEN | \ STANDARD_RIGHTS_REQUIRED)
Whenever it use DESKTOP_ALL and WINSTA_ALL ,I got "C2017:illiegal escape sequence".I have to delete \ there to get rid of this error,Could anybody please tell me about this charachter here?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
It looks like the original code was
#define DESKTOP_ALL (DESKTOP_READOBJECTS | DESKTOP_CREATEWINDOW | \
DESKTOP_CREATEMENU | DESKTOP_HOOKCONTROL | \
DESKTOP_JOURNALRECORD | DESKTOP_JOURNALPLAYBACK | \
DESKTOP_ENUMERATE | DESKTOP_WRITEOBJECTS | \
DESKTOP_SWITCHDESKTOP | STANDARD_RIGHTS_REQUIRED) and got reformatted. Putting a backslash at the end of a line makes the preprocessor join that line and the next into one big line. You usually only see this with huge macros, like your examples.
--Mike--
If it doesn't move and it should: WD-40. If it moves and it shouldn't: duct tape.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Thanks Mike,So it doesn't mean anything special and when I delete them does not change th e meaning?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
That's correct.
--Mike--
If it doesn't move and it should: WD-40. If it moves and it shouldn't: duct tape.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
The \ character is usually used for putting newlines and tabs into strings (\n & \t), I can't see why they should be in those two #defines though but admittedly I've never had to use them.
|
|
|
|
|
Like Mike said, if the last line of a macro is a \, then the macro spans the next line also
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
if i Write a code that it Creats a CWnd Object in the main Window, how can i capture the mouse event in it ??? i know that this CWnd object has the Function onMouseMove or onLButtonDown or other Functions for Mouse Events but how can i trap them ???
when i move the mouse over that CWnd Object the Focus Set to this object.and in return the Mouse Event of the main window will lose. but it must be exist a way to capture the Events of the Focused window.
I am realy confused
Here is Code:
//When i Right Click CW Creats.
//CW is a Member Variable of the class
void CMyTestView::OnLButtonDown(UINT nFlags, CPoint point)
{
CW=new CWnd;
CW->Create(NULL, "",WS_VISIBLE|WS_CHILD|WS_CLIPSIBLINGS ,CRect(0, 0, 26,26), this, 0xffff);
}
|
|
|
|
|
CWnd* p = GetParent();
if (p) p->SendMessage(...);
|
|
|
|
|
When I use printf to display a double variable it gives a wrong result, but when I turn to use a cout to do the same thing it just did it right. For example:
...
double getValue()
{return value; // value is a double variable}
...
printf("%d\n", getValeue()); // gives a incorrect result
cout << getValue() << endl; // right
What are the differences between these two methods? Thanks!
|
|
|
|
|
What do you mean by incorrect?
How about an example of the output.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
The problem with the first one is that %d is for ints only, you should use something like %f. Or maybe thats just my hungover brain thinking poo again
|
|
|
|
|
LOL, silly me. I didn't notice that.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
%d is the format spec for integers. Use %lf for a double (think "long float").
--Mike--
If it doesn't move and it should: WD-40. If it moves and it shouldn't: duct tape.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
ummmmm
printf("%d",value);
is for integer values
try printf("%f",value);
for floats or doubles
"traffic lights are for people who can't make their own decisions" biz stuff about me
|
|
|
|
|
You are not using the correct format code in the printf . Try something like this:
double x = 123.456;
printf("This is x: %lf\n",x);
should print the following:
This is x: 123.456 Your original code used the %d format, which is used for int 's.
Software Zen: delete this;
|
|
|
|
|
hi all,
i am stuck.please help. my problem is I want to make a setup program for my vc++ application as we have in VB.can anyone help me out?
thanks in advance
regards
Himanshu
|
|
|
|