|
I use XML4C[^] - it's fast, free and open source!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hello friends,
I am using a TVisualObject class given by Zoran M. Todorovic
I am able to split and place the tabs but one of the splitted window is occupying the entire space.I tried with changing the parametrew of CSize fn but its not working.i have attached the piece of code.Please suggest me to resize the window.
TVisualObject *pSplitter = new TVisualObject(1,"", 2, 1, pContext);
TVisualObject *pView1 = new TVisualObject(2,0,0,pContext, RUNTIME_CLASS(CDummyEdit), CSize(0,880));
TVisualObject *pView12 = new TVisualObject(13,0,0,1,2,pContext);
TVisualObject *pw12 = new TVisualObject(14,0,0,pContext,RUNTIME_CLASS(CDummyEdit),CSize(330,30));
TVisualObject *pw22 = new TVisualObject(15,0,1,pContext,RUNTIME_CLASS(CDummyEdit),CSize(0,80));
TVisualObject *pViewtab1 = new TVisualObject(3,1,0,pContext,RUNTIME_CLASS(TTabWnd),CSize(770,660));
TVisualObject *pTabView1 = new TVisualObject(4,"Log",pContext,RUNTIME_CLASS(CDummyEdit));
TVisualObject *pTabView2 = new TVisualObject(5,"Summary", pContext,RUNTIME_CLASS(CDummyTree));
//pTabView2->SetIcon(IDR_FINALTYPE);
m_Framework.Add(pSplitter);
m_Framework.Add(pSplitter, pView12);
m_Framework.Add(pView12,pw12);
m_Framework.Add(pView12,pw22);
m_Framework.Add(pSplitter, pViewtab1);
m_Framework.Add(pViewtab1,pTabView1);
m_Framework.Add(pViewtab1,pTabView2);
m_Framework.Create(this);
TVisualFrameworkIterator it(m_Framework);
while (!it.End()) {
TVisualObject *pObject = it.Get();
it++;
}
m_Framework.SetActivePane(pView12);
return TRUE;
|
|
|
|
|
Hi guys,
first of all, I'd like to say hi. It is my first time here.
I am having a task to write a program on MS V++ to open/close/query some information about hardware drivers from registry.
I have managed to find appropriate functions that could come in handy. RegOpenkey();
RegCloseKey();
etc..
My question is regarding to RegOpenKey() specifically.
From MSDN, RegOpenKey is defined as
LONG RegOpenkey(
HKEY hKey,
LPCTSTR lpSubKey,
PHKEY phkResult
);
I am trying open a subkey in a location such as HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCMCIA\WLANCARD\1
I am wondering, if it is allowed to directly open the bottom subkey (\1) of this registry directory string, done as below.
HEKY hKey;
if (RegOpenKey(HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Enum\PCMCIA\WLANCARD\1", &hKey) == ERROR_SUCCESS);
MessageBox("The registry is open successfullly");
I don't seem to get correct response with the code
Thanks alot
|
|
|
|
|
if (RegOpenKey(HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Enum\PCMCIA\WLANCARD\1", &hKey) == ERROR_SUCCESS);
I hope there is a subkey by that name ..
secondly
change "\" to "\\" ..it will be
HEKY hKey;
if (RegOpenKey(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Enum\\PCMCIA\WLANCARD\\1", &hKey) == ERROR_SUCCESS);
|
|
|
|
|
Do not directly to the registry: there are several undocumented issues. rely on the setupapi described in details in DDK and SDK.
Here a short list of most important API:
SetupDiGetClassDevs opens a list of specific devices
SetupDiEnumDeviceInfo enumerates a kind of devices of specific type.
SetupDiGetDeviceInterfaceDetail gest the interface in order to open the handle for a specific device
and so on...
Regards
|
|
|
|
|
I use following code to hook other program's MOUSE message:
m_hHook=SetWindowsHookEx(WH_MOUSE,HookProc,AfxGetInstanceHandle(),dwReturn);<br />
the var m_hHook is defined for record the MOUSE HOOK,and these code whin a dll program.dwReturn was a var for a Dlg based program's thread ID.
when I debug it,I found that it it can set hook to the Dlg based program.but the process HookProc was never be called.
is there some error in my code?But my code just simple as above.
And the HookProc as follow:
<br />
LRESULT CALLBACK HookProc(int nCode, WPARAM wParam, LPARAM lParam )<br />
{<br />
return CallNextHookEx(m_hHook,nCode,wParam,lParam);<br />
}<br />
In my opinion,everything is OK!
But when I click my mouse in the DLG based program,the process HookProc had never been execute!
IS there somethingwrong?
Don't look at me in that way!
|
|
|
|
|
If you use global hook you should assure that the hookproc is in a dll module,
make sure that the instance is your dll module instance,and the last parameter must be 0
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
I am sure that the process HookProc is in a dll module.And the instance is the dll module instance.And I only want hook a dlg based program not global.So I think the 4th paramter is the Thread ID of the Dlg based program.
All of these parameters are checked correct.
By the way,If I make the 4th parameter to 0,the HookProc will be called when the mouse message was occured.And everything is OK!
But I only want to Hook a special Program.
How can I do?
thank you for help me!
Don't look at me in that way!
|
|
|
|
|
if you want install a local hook,the instance parameter should be NULL and the last parameter is the ID of your thread
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
How can I prevent the entire app directory from changing at the start of my program when someone double clicks the related file extention from windows explorer.. I'm not using the doc class. How can I prevent this b/c Its awfully ANNOYING!
-Steven
CPACodeProjectAddict
By reading this message you are held fully responsible for any of the mispelln's or grammer, issues, found on, codeproject.com.
For those who were wondering, actual (Linux) Penguins were harmed in creating this message.
|
|
|
|
|
I need to transmit the pointer of the CDialog to the parent > I am not able to set a member of the
parent because it doesnt fit with my scheme. So can I do this?
m_pParent->SendMessage(UDM_SOMETHING, this, ndummy)
?
Thanks
|
|
|
|
|
One solution is GetParent(). Another solution is AfxGetMainWnd().
Kuphryn
|
|
|
|
|
Cant do those. I am unable to include my view.h file into the cdialog.h file due to deeply entrenched circular includes...
So is SendMessage a bad idea?
|
|
|
|
|
nss wrote:
I am unable to include my view.h file into the cdialog.h file due to deeply entrenched circular includes...
But you should be able to include it in the cpp file, and just forward declare the class in the header file.
Anyway, SendMessage will work (although it is not really necessary here). You can do something like:
GetParent()->SendMessage( dlgPointerMessage, reinterpret_cast<wparam>( this ) );
And in the parent message map:
ON_MESSAGE( dlgPointerMessage, OnDlgPointerMessage )
LRESULT OnDlgPointerMessage(WPARAM wParam, LPARAM lParam)
{
CDlg* pDlg = reinterpret_cast<CDlg*>( wParam );
ASSERT_VALID( pDlg );
// Do something
return 0;
}
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Terrific! Many thanks.
I also wonder if GetParent()->RunParentFunction() would work.....I will try it. Apprecite your help greatly! I didnt know about the reinterpret_cast....
|
|
|
|
|
It won't directly because GetParent() returns a CWnd pointer. But if you know exactly what type it is, you can cast it and then call your function.
static_cast<cparentclass*>( GetParent() )->RunParentFunction();
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
|
IT works!! The only thing is that I think in your earliest post with the reinterpret_cast, the <> were missing so I guessed you meant:
m_pParent->SendMessage(MSGE, ndummy, reinterporet_cast<UNIT>(this));
I did this by deducing it might be what you meant and its seems fine. Is this indeed what you intended I should do? Your post says
interpret_cast (this) but it wouldnt compile that way--- not until I put in the type to cast to.....
So is that okay or did you mean something else?
Thanks!
Appreciate your help,
ns
|
|
|
|
|
I meant to put in the angle brackets, but i forgot that CodeProject interprets them as HTML, so they got gobbled up...
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Hi all, I am trying to develop my own win32 custom button class. I was just wondering if anyone knew where there was a good article on this as I am a little stuck on handling mouse messages. I would also like to make it a bit more generic so that it did not rely on windows messaging so I could derive a class for use with DirectX to custom draw the control in the appropriate state or use GDI for windows apps. Its more the windows messaging thats the problem, unless I use TrackMouse...() I never know when to turn o the highlight state, and have other problems if I use it with WM_SETCURSOR (I can't see if the left mouse button is down). Any help or links would be invaluable,
Many Thanks,
Alan.
P.S. I'm not interested in sub-classing MFC or win32 buttons this is my own complete implementation.
|
|
|
|
|
Folks.... this is a repeat from 'General Discussion' message board, but I will not repeat in its entirety.
I asked there (and code provided) if it is possible to access using NO MFC, a dialog box with an activeX control placed on it (DataGrid)?
I have been able to access a Dialog box (nonMFC) but once a ActiveX control was placed on it, WM_INITDIALOG never gets called.
Please look in the 'General Discussions' messageboard for more details and with code provided.
Thanks to all who responded in advance!
|
|
|
|
|
Just a straightforward question: is it possible to have a virtually unlimited number of Direct3D (8) views open in an MFC/MDI application? I guess that only one drawing surface should reside in video memory at the particular time, while these of inactive views somehow get swapped to the RAM.
If you happen to know the solution, or know someone who knows - I would greatly appreciate any help with this nasty problem.
Regards,
BB
|
|
|
|
|
After closing my app the debugger reports this warning:
Warning: calling DestroyWindow in CDialog::~CDialog --
OnDestroy or PostNcDestroy in derived class will not be called.
Any ideas what can cause this? What can I be doing wrong? What should I look for to correct this? Thanks.
|
|
|
|
|
You're probably delete ing a modeless CDialog without first calling its DestroyWindow() .
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ravi,
Thanks for the feedback. I think these are being caused from property pages of a property sheet. Does this make sence? If so how do I correctly delete pages from a sheet? Thanks!
|
|
|
|
|