|
... is called ellipses (msdn)[^]. It is used to pass variable number of arguments to a function..
-Saurabh
|
|
|
|
|
Hi,
Is there any way to capture the events of a dynamically created CPropertySheet ?
The code looks like the following where the m_Sheet member is the CPropertySheet.
m_Sheet.AddPage (&m_SheetBasic);
m_Sheet.AddPage (&m_SheetDetails);
m_Sheet.AddPage (&m_SheetExtras);
m_Sheet.AddPage (&m_SheetPhoto);
m_Sheet.Create (this, WS_TABSTOP | WS_CHILD | WS_VISIBLE,WS_EX_CONTROLPARENT);
m_Sheet.SetWindowPos (NULL,0,130, 0,0,SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
I would like to capture the change sheet (tab) event. Is that possible since there is no ID code ?
Regards,
sdancer75
|
|
|
|
|
I need to get the name of current module (dll). I dont have the HMODULE or the name of the module.
Thanx n Advance
AD
|
|
|
|
|
void *ptr = ...;
HMODULE hnd = NULL;
char str[MAX_PATH] = "";
if( ptr ) GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, ptr, &hnd);
if( hnd ) GetModuleFileNameA(hnd, str, __countof(str));
Where ptr is set to a pointer to a function or (dll global) variable that belongs to the dll.
By 'current module' i assume you mean you are in a function that resides in a dll and you want to find what dll.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Thanks alot cmk
Yes I am in the function that resides in a dll and I want to find what dll it is.
I have this technique in mind but
GetModuleHandleEx Requires Windows XP.
Is there anything that I can use for Win2K ?
I will give this a try in XP.
AD
|
|
|
|
|
Adnan562 wrote: I am in the function that resides in a dll and I want to find what dll it is.
Just save the handle in your DllMain().
0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 4294967295 bottles of beer on the wall.
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
Thnx Muraoka
I cant get it from DllMain() as i am hooking another process and injecting my own code there.
I dont know where its DllMain() is.
AD
|
|
|
|
|
If you have ptr (as in previous example) you can use:
MEMORY_BASIC_INFORMATION mi;
memset(&mi, 0, sizeof(mi));
if( !::VirtualQueryEx(PROC, (cvoid*)ptr, (MEMORY_BASIC_INFORMATION*)&mi, sizeof(mi)) ) return(0);
char fn[MAX_PATH] = "";
ulong sz = ::GetModuleFileNameA((HMODULE)mi.AllocationBase, str, _countof(str));
if( !sz ) return(0);
[EDIT]
Instead of VirtualQueryEx you could also use:
void *base = SymGetModuleBase(PROC, ptr);
if( !base ) return(0);
... GetModuleFileNameA(((HMODULE)base, ...); [/EDIT]
...cmk
Save the whales - collect the whole set
-- modified at 18:11 Saturday 29th April, 2006
|
|
|
|
|
Hi cmk
Thnakyou cmk
Although it dint work for me, caz I am hooking into another process memory but it did help in gaining knowledge.
Here is a link of Experts Exchange where i also asked this question;
Experts Exchange[^]
Adnan
AD
|
|
|
|
|
Adnan562 wrote: it dint work for me, caz I am hooking into another process memory
They should work.
The PROC variable (in the example code i provided) is the handle of the _other_ process.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Hi cmk!
Let me explain the whole thing.
It dont work caz, I inject my code into another process with the help of starting a CBT hook, which loads my dll to all the processes.
Once my dll is loaded to a process I want, Then I replace a few bytes in that process and redirect a function call to my dll.
Now when the control comes to my dll, I want to determine which module called it. I dont have address to any varaible in that module. If I create one it is either in heap or stack, which wont work as you said.
So thats why it wont work, I dont know if there is a way around it ?
AD
|
|
|
|
|
|
WOW it worked,
Thanx alot cmk,
Thanx Thanx Thanx.
This is just great , I thought it wont be possible.
AD
|
|
|
|
|
Hi,
As I select my graphic line and drag it to move to other place, the whole
bounding box shows up. I just want to see the handles at its end points.
How I may achive this.
Thank you.
Leya
|
|
|
|
|
yang__lee wrote: I just want to see the handles at its end points.How I may achive this.
CRectTracker won't help here. You'll need to make your own class or find one on the web. I don't know of any off hand, but it's not very difficult to do your own.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hello to All,
Can any one help me how to display console windows inside the dialog box as in many rs232 monitring softwares console type window is embeded in dialog .
|
|
|
|
|
Use a multiline edit control.
Software Zen: delete this;
|
|
|
|
|
Although your solution is the best way I know, it is not a direct implementation. We must handle scrolling ourselves, since the edit control will try to keep the initial line visible, instead of the last. Also, we must make it so that the text box does not grow indefinitely.
To simulate a real console the number of characters must be fixed. I assume the requirement is not as strong, and that it is acceptable to have a limited number of lines that doesn't match the draw area exactly. In this case the user can then scroll up to see some of the previously shown text.
Rilhas
|
|
|
|
|
Hi,
I am drawing a line pDC->Line(...) in my view 1.. suppose there are 3 more views for the same document are open . The views which are referencing same area as view 1 should also reflect the rubberband effect as I go on placing the line. now current effect if.. first I complete the placement of line
in view 1 then I call GetDocument()->UpdateAllViews(NULL, 0, NULL); so the line reflects in other views aswell. I want to see the line placement in all views as its in progress. How I may achieve it. calling UpdateAllViews in MouseMove event may not have irritating effect.
any idea?
Leya
|
|
|
|
|
Application developed in vc++.After sometime i got this error
Error info:
exe has generated errors and will be closed by windows.You will need to restart the program
raghu
-- modified at 7:49 Saturday 29th April, 2006
|
|
|
|
|
I'm afraid we'll need a little more information then this to get anywhere with your problem.
Steve
|
|
|
|
|
should i send u windows error dialog box
|
|
|
|
|
stephen how to post the windows error dialog box.can u give a detail info
|
|
|
|
|
your program may read/write the protected memory, so the windows let you restart your program.
Good luck;)
|
|
|
|
|
Run your program in the debugger and Visual Studio will break when the exception is generated.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|