|
Hello, I have a little problem,
I need to get a pointer on the first page of my wizard application in order to perform other actions with Next and Back buttons, but it doesn't seem that the compiler like the way I do it...
Here is what I do :
blablaMP =
(CblaBla*) pParent->GetDescendantWindow(IDW_BLABLA);
if(blablaMP == NULL) AfxMessageBox("NULL POINTER");
When the page is created, I use
Dlg.AddPage(&blablapage,CblaBla::IDD);
with the correct instanciation. There, pParent doesn't = NULL, but when I am in my default constructor in blaBla class, pParent worth NULL...
Therefore, I can't use the values that are in the first page and I need them...
Could someone help me please ?
Thank you.
Sly
|
|
|
|
|
Try using CPropertySheet::GetPage ().
...<br />
CPropertyPage * pSomePage = pParent->GetPage( 0 );<br />
...
Where pParent is a pointer to a CPropertySheet.
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
Hi,
I like to know if anyone knows how to have the application windows maximized when the application starts..
i'm using this function and it doesn't work..
void CChildFrame::ActivateFrame(int nCmdShow)
{
// TODO: Add your specialized code here and/or call the base class
CFrameWnd::ActivateFrame(SW_MAXIMIZE);
}
Ehsan Behboudi
|
|
|
|
|
It works OK for me. Do you want to maximize main application window or MDI child?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
I like to maximize both.. the application window and the chid window,,
i can maximize the child window,,
but i can't maximize the appliation window.
Ehsan Behboudi
|
|
|
|
|
To maximize the main window set m_nCmdShow = SW_SHOWMAXIMIZED; in the application's init instance.
|
|
|
|
|
Thank you,,
the job is done
Ehsan Behboudi
|
|
|
|
|
Hi, I'm not sure which category to post this question. I've gone throught he shell programming examples on the site(very good). One example, regarding the "Send To" option when you right click a file. It works fine for folder, but when I try to send it to a web folder it just displays the contents of the web folder instead of allowing me to send the file to it.
How would I go about, in creating a shortcut to the web folder (because that seems to work, but I do not know how).
Any help is much appreciated,
QVL
|
|
|
|
|
Please help a novice...
You know how in Windows Explorer you can right click a file, select Properties, and the dialog appears? I need files of a particular extension to execute MY DLL in lieu of the Windows File Properties actions. Does anyone know how to do this? I'd appreciate any help.
Thanks.
|
|
|
|
|
The Properties menu item is part of the OS (it connects to some OS functions that tell you stuff like the date the file was created, last modified, MSDOS name, etc). You can edit the registry to add addition items to the menu (ie "Settings" in addition to the "Properties" menu item). To do this, you can edit the registry by hand or copy the following script (replacing with your apps names and extensions
; Script starts here
REGEDIT
HKEY_CLASSES_ROOT\.ext = My.Document
HKEY_CLASSES_ROOT\My.Document = My Document
HKEY_CLASSES_ROOT\My.Document\shell\mycommand = &My Command
HKEY_CLASSES_ROOT\My.Document\shell\mycommand\command = "C:\thing\to\execute" "arguments"
; End script
Replace . . .
.ext with your extension
My.Document with your Document type (must match with the Document type your application wants)
My Document with you Document name (can be anything you want to appear in Windows Properties
mycommand with the name of the command you want (ie Settings)
&My Command with the string you want to appear in the drop down menu (the & will underline the following character so if you right click and press M, for this example, it would run My Command)
"C:\thing\to\execute" with the path to your program or dll (you may need a surrogate for a dll)
"arguments" with any arguments your application needs (ie filename)
Hope this helps
Zac
|
|
|
|
|
Thanks for your help
This requirement is always changing...
|
|
|
|
|
Is there any way to get Grand Child of a process
|
|
|
|
|
On Win9X and 2000 (not NT4) you can use TOOLHELP api. You call CreateToolhelp32Snapshot, then iterate over the snapshot using Process32First/Process32Next. Process32xxx functions fill PROCESSENTRY32 structure, and one of the members is th32ParentProcessID - check it to determine the parent-child relationships.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
I need to test a program that sends and receives data over a serial port. It will eventually connect to some specific hardware, but for the moment I need a program that will emulate the responses the hardware would give. So here's my problem. . .
Program 1 will send and get data on the serial port.
Program 2 will respond over the serial port to Program 1.
Program Proxy will redirect the communication from the actual serial port to the programs (ie Program 1 sends data, the proxy redirects it from the serial port to Program 2).
Program 1 and 2 are easy (they will just use standard Serial communication protocol). However, the Proxy is where I am getting caught. Does anyone know how I can get information being written to the serial port and redirect it to another program on the same machine?
Thanks
Zac
|
|
|
|
|
I think you could either:
1) Get another serial port and wire it up to your existing one in a loopback.
2) Use named pipes for the comms while you are testing instead of serial port.
Either way there is no need for the proxy program.
|
|
|
|
|
I use spawncl(...) to run other applications.
I then get the hWnd of the new application.
(i use a hook to see when a wnd is created/activated/destroyed)
The fuction ::GetWindowText(...) works fine and i get the windows title.
But when i call ::GetWindowModuleFilename(...) i get the filename of
my application, not the new one.
If i run Task manager, i can see the filename of the new application!
What can i do? Is there another way to get the filename instead
of ::GetWindowModuleFilename(...) , or i souldn't use spawn(...)
and use CreateProcess(...) or RunWin(...) ?
- - - - - - - - - - - - - - - - - -
Memory leaks is the price we pay \0
01234567890123456789012345678901234
|
|
|
|
|
What exactly is the problem? You are passing the executable filename to the spawn/CreateProcess/WinExec. Why do you want to retrieve it using hwnd? Do you think Windows is replacing your exe with something else?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
How can i disagree.
You are right!
I didn't describe it correctly.
My application sets a system hook to
get notified for all created windows.
That's why i want to get the filename
from the hWnd. It's not limited to the
programs that i run with spawn*(...).
- - - - - - - - - - - - - - - - - -
Memory leaks is the price we pay \0
01234567890123456789012345678901234
|
|
|
|
|
How can i disagree.
You are right!
I didn't describe it correctly.
My application sets a system hook to
get notified for all created windows.
That's why i want to get the filename
from the hWnd. It's not limited to the
programs that i run with spawn*(...).
- - - - - - - - - - - - - - - - - -
Memory leaks is the price we pay \0
01234567890123456789012345678901234
|
|
|
|
|
This doesn't work on NT or Win2K!
See http://msdn.microsoft.com/library/psdk/winbase/psapi_9cc3.htm
Mh2x
|
|
|
|
|
I quess i have to do the following:
DWORD ProcessID;
GetWindowThreadProcessId(hWnd,&dwProcessID);
HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION| PROCESS_VM_READ,FALSE, processID );
HMODULE hMod;
DWORD cbNeeded;
EnumProcessModules( hProcess, &hMod, sizeof(hMod),&cbNeeded);
GetModuleBaseName( hProcess, hMod, szProcessName, sizeof(szProcessName) );
CloseHandle( hProcess );
i will try it tonight.
Thanks.
- - - - - - - - - - - - - - - - - -
Memory leaks is the price we pay \0
01234567890123456789012345678901234
|
|
|
|
|
Is there an easy way to create a dialog app that when executed doesn't appear but is still running in the background?
Thanks in advance!!
Rob Jones
|
|
|
|
|
Do you expect your dialog to be always invisible? Or only until some event occurs?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
|
If your app targets NT/W2K only, you can consider creating a service. If you need to run on Win9x, hiding main window should work.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|