|
if you can catche handle of a window , then you can do any thing
|
|
|
|
|
Thanks for your reply,
How to catche handle of a window so taht i can call all other function from there.So taht window will start display which i am getting from server.
|
|
|
|
|
All you need is have one more modal dialog and then do a DoModal dialog in the menu command handler.
|
|
|
|
|
Thanks for your reply,
Can you pls explain me more.As i am new to CV++ ,so all the concept are not clear to me.
If you need more information then pls.
|
|
|
|
|
See CWnd::GetParent
if Main is Main class you can use this code ion another class
CMain* m_Main=(CMain*)GetParent();
m_Main->functiron or data
|
|
|
|
|
Thanks for reply,
I need to ask my project is dialog based wil these work with that.
If yes what should all other thing/class should i include to make these function work
|
|
|
|
|
Priyanka... Let me know whether you want to create another dialog box from this dialog box?
If yes
Just place this code in the hanlder of that menu item
<br />
CSecondDlg secDlg;<br />
secDlg.Domodal();
if this isn't enough come with your next question.
KIRAN PINJARLA
|
|
|
|
|
no kiran i dont want to create second dialog,
let me expalin you....
I have function which i am calling through dialog box.now i want that by clicking a button it will open a window(which will open untill click to exit) and from that window i will b able to call all other function so that it will start display the data getting from server.
Hope i am clear if not pls remind me
Thanks for your reply
priyanka
-- modified at 1:27 Monday 7th August, 2006
|
|
|
|
|
if your program dialog yes and see GetParent in msdn this function obtain a pointer to parent window
|
|
|
|
|
problem is that I want to disable one of buttons in the toolbar,
for example:
I create a toolbar in an application based dialog:
if (!toolbar.CreateEx(this,<br />
TBSTYLE_FLAT|TBSTYLE_TRANSPARENT <br />
, WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP, <br />
CRect(0, 0, 0, 0), AFX_IDW_TOOLBAR) <br />
||!toolbar.LoadToolBar(IDR_TOOLBAR1) )<br />
{<br />
TRACE0("failed to create toolbar\n");<br />
return FALSE;<br />
}<br />
<br />
toolbar.SetButtonText(0," config "); <br />
toolbar.SetButtonText(1," connect ");
toolbar.SetButtonText(2," transport ");<br />
toolbar.SetButtonText(3," disconnect ");<br />
CRect rc(0, 0, 0, 0);<br />
CSize sizeMax(0, 0);<br />
CToolBarCtrl& bar = toolbar.GetToolBarCtrl();<br />
for (int nIndex = bar.GetButtonCount() - 1; nIndex >= 0; nIndex--)<br />
{<br />
bar.GetItemRect(nIndex, rc);<br />
rc.NormalizeRect();<br />
sizeMax.cx = __max(rc.Size().cx, sizeMax.cx);<br />
sizeMax.cy = __max(rc.Size().cy, sizeMax.cy);<br />
}<br />
toolbar.SetSizes(sizeMax, CSize(16,15));<br />
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);<br />
Now, I want to disable the button , which that ID is IDC_CONNECT, I had mark it , what can I do , how to add codes to change the state of the toolbar's button?
waiting for answers online!
-- modified at 0:02 Sunday 6th August, 2006
Just my interest for these common things
|
|
|
|
|
toolbar.EnableButton(IDC_CONNECT, FALSE);
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
EnableWindow()
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
|
thank you very much, I believe I can do it now !
Just my interest for these common things
|
|
|
|
|
Does anyone know about a decent standalone c-cpp pre-processor (preferably with source code), written in c or cpp.
LateNightsInNewry
|
|
|
|
|
|
If you are not looking for source code, but want to see how pre processing takes place , the /E option of Microsoft c/c++ (cl.exe) compiler will generate preprocessed output.
|
|
|
|
|
Check out Boost's Wave library here[^].
Steve
|
|
|
|
|
I am using an instance of the CMonthCalCtrl class. However when I executed the application and click on the a specific date, the date disappears and in some cases half of a rectangled border develope around the normally oval blue date. When I use the CDateTimeCtrl class (with the calendar functionality) this does not happen.
I believe this is simply a redraw error because when I click forward a month the selected date redraws properly.
Any ideas?
I am using Visual Studio 2003 and I am running XP Multimedia. I am using a digital widescreen flat panel display (24") which occaisionally has problems properly rendering borders on objects on web pages.
-- modified at 19:45 Saturday 5th August, 2006
When I rotate my monitor 90 degrees the control renders properly (as do the webpages that exhibit the rendering problem mentioned above).
|
|
|
|
|
The fact that things change when you move the monitor indicates that you have a 'brown' connection somewhere. This has absolutely nothing to do with programming,(unless if you in moving the screen inadvertely move the mouse, touch the keyboard, or, if you have a touch screen, when moving the monitor).
In that case, be more carefull, and debug the appropriate input!
Otherwise,You are in the wrong forum for this type of problem, but, as free advice (for once) I offer the following:-
Place your system, (Desk and all), in the middle of the room!
Get your System up and running, and gently move the Cables around one by one, without disturbing the other cables.
Start with the Powe Cables, and Plugs. Differentiate between the Plug and the cable!
Put Tension on each cable. When the system dies, you found a 'brown' circuit!
Replace the Cable, If the problem persists, it is either the Connector protruding from the equipment, or the inner hardware soldered to the connector.
If the problem has gone, it probably was the Lead! THROW IT OUT! (If you keep it in the garage, just foor keeps, you may be on to this bulletin board again with the same problem, stating that you tried the above with a flex you had in the garage, and you cannot find the problem!
LateNightsInNewry
|
|
|
|
|
Hey
I am trying to use SetWindowHookEx() API to inject my code into another process, but I am kinda lost with the hook procedure that should be placed in the .dll file
is there an explaination about how to build a hook procedure?
thanks in advance!
|
|
|
|
|
See these CP articles:/ravi
|
|
|
|
|
|
thank you for the usefull links, and this is my first try:
this is my callback function
LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lParam)<br />
{<br />
if (nCode<0)<br />
return CallNextHookEx(0,nCode,wParam,lParam);<br />
if (wParam == WM_RBUTTONDOWN)<br />
{<br />
MessageBox(GetForegroundWindow(), "Yes", "Works", MB_OK);<br />
} <br />
return CallNextHookEx(0,nCode,wParam,lParam);<br />
}
and in onbutton function I set:
<br />
HOOKPROC wlm;<br />
HHOOK check;<br />
HINSTANCE WLMDLL;<br />
<br />
WLMDLL = LoadLibrary((LPCTSTR) "MyHook.dll");<br />
wlm = (HOOKPROC)GetProcAddress(WLMDLL, "MouseProc");<br />
<br />
check = SetWindowsHookEx(WH_MOUSE,wlm,WLMDLL,0);<br />
as you can see I am trying to do a mouse hook, this try is to get any right click, but later when I get it to work, I want it to be for a defined application that when it gets right click the the popup pops up
can you see what I am doing wrong in my code?
thanks in advance!
|) () |) '/
|
|
|
|
|
I am trying to inherit from a class template (CGenericList) in the constructor, however the compiler is returning:
SentenceList.cpp(6): error C2512: 'CGenericList' : no appropriate default constructor available
SentenceList.cpp
CSentenceList::CSentenceList(char strFileToRead[MAX_SENTENCE_LENGTH], bool bSorted)
: CGenericList()
...
GenericList.h
#pragma once
#include "GenericNode.h"
#include <iostream>
using namespace std;
template<class T>
class CGenericList
{...}
Jon
|
|
|
|
|