|
|
|
Hi, I'm using a CEdit control as a Window that I can resize and move around, but I can't seem to place a Caption Title to it and places whatever I have on the text as a title (pretty ugly stuff!!)
Anyone knows what to do here?
Here's one of the windows:
CEdit m_wndTextSeg;
m_wndTextSeg.Create(ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | ES_NOHIDESEL | WS_OVERLAPPEDWINDOW | CLIPSIBLINGS, r,this,1);
Please... help!! thanks!!!
Jorge Lepervanche
-----------------
Carpe Diem!!!
|
|
|
|
|
A CEdit should normally be used as a child window, not a top-level window. Can you embed the CEdit in a dialog and set its (the dialog's) caption?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hello,
you create a Static control and change the caption using SetWindowText().
With Regards,
R.SElvam
|
|
|
|
|
Hi.
I’m trying to create MDIChild from dll. I have a MDIExe project and MFCExtension dll. The dll have a MDIChild window and EXE will use that MDIChild. The Dll is responsible for the WindowPointer of MDIChild. In other word, memory allocation and creation of MDIChild arise on it.
To get Mainframe’s pointer properly the dll has some global exported functions and variables and Mainframe has set “this” pointer to dll. But whenever try to create it, WM_MDICREATE don’t processed…
On Mainframe’s OnCreate() I set self pointer to dll.
G_SetMainFrameWnd(this);
And call the dll’s creation function.
CCreator creator; - Exported class from the dll.
creator.CreateMDIWnd(1,1);
In createMDIWnd() below is happen.
AFX_MANAGE_STATE(AfxGetAppModuleState())
CMDIWnd *pWnd = new CMDIWnd;
pWnd->Create();
and
CMDIChildWnd::Create("TEST", _T(""), dwStyle, rectDefault, (CMDIFrameWnd*)G_GetMainFrameWnd());
And finally I can’t get hWnd from below line.
HWND hWnd = (HWND)::SendMessage(pParentWnd->m_hWndMDIClient,
WM_MDICREATE, 0, (LPARAM)&mcs);
Is there any missing point?
Thanks.
|
|
|
|
|
I'm writting an MFC Doc/View program which allows user loading DLL at runtime.
In the test DLL, I append a popup menu to the mainframe and it looks OK.
But the problems are,
if the ID number of added menu item is the same as that of existing menu item or toolbar button, selection on the added item will invoke the function of the existing one, not that of the DLL;
if the ID number of added menu item does not exist in mainframe before, the menu item will be disabled. Although we can use CFrameWnd::m_bAutoMenuEnable to do the trick, it's not good way, for all the menu items and button will be affected.
Looking into the wParam and lParam of WM_COMMAND message handler CMainFrame::OnCommand(), it's found that there's no difference between two menu items with the same ID number.
Any way to solve it? how does people add menu or toolbar button to MS Word?
|
|
|
|
|
THis article of mine provides an entire framework which does what you are trying to do:
MFC plug-in architecture[^]
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
Yes, your frame solve the problem of route messages to addin dll.
There's another problem, just mentioned in your article, the unique ID number across EXE and DLL must be ensured.
But my application is only a platform EXE, and the DLL developers will be any other people, How could we ensure unique ID numbers?
|
|
|
|
|
I am trying to make a 3D desktop style program. Written in c++ and openGL. I need it to be displayed in a full screen window whilst still showing the start bar, I've managed to half achieve this using an overlapped window but it still has a frame and title bar round the window which I don't want. Anyone know how to do this? Secondly I need it to run behind all other windows at all times whether they are active or not, and I have had trouble finding out how to do this as well. Sorry if i've posted this in the wrong forum but I couldn't see any that were particularly relevant, i'm quite new to C++ and win 32 programming so finding it a strugggle and any help would be greatly appreciated.
Cheers.
|
|
|
|
|
I know that using SystemParametersInfo with the SPI_SETMENUSHOWDELAY parameter it is possible to adjust the time it takes for a sub menu to open when the mouse cursor is held over a submenu item. Even when the flags are set to not update the user profile or broadcast the change to other windows, this is still a system wide change. Any windows opened after a change is made will use the new settings until the current user logs off then back on.
I am looking for a way to adjust the menu show delay at the application level. Is there an easy way to accomplish this that I am not seeing?
|
|
|
|
|
Im new to network programming. Let me tell what my requiremets are.. And Please suggest me the psooible solutions.
I have a server computer to which a hardware is attached. The hardware works on TCP/Ip. The requirement is to connect to the hardware remotely from any client machine. So to avoid the hardware being availabe to everybody(not to keep it in public network), we have created a subnet in which the hardware and the server computer reside. Now i have to talk to the hard ware using the APIs and command sets provided by the harware vendor thro any client machine. So i need some thing ( may be a software routing) that makes it possible for the client machine to control the hardware after getting the permission from the server.Server computer is also part of the bigger network. In other words server compuet will have 2 ethernet cards one for talking to the hardware another for talking to the rest of the world. Any help / code to do this is greately appreciated.
|
|
|
|
|
There are several solutions. One solution is socket. Another solution is COM.
Kuphryn
|
|
|
|
|
Thanks for the reply. How do we do it using sockets?? I do not want to parse any of the commands that come from client to the server meant for the hardware. They should be directly routed.
shashi
|
|
|
|
|
Does your hardware and server have separate an ips ?
greatest thing is to do wot others think you cant suhredayan@omniquad.com
|
|
|
|
|
yes the server and hardware have seperate IPs and they reside in a subnet. Only thing is that the server has 2 ethernet card so 2 IPs. One for just communication with the hard ware other for communication with other computers and internet.
shashi
|
|
|
|
|
Wot about providing a web based interface on the server so that clients can communicate with the hardware after they are authenticated.
Providing an interface (with no direct connection to hardware) on the server will always help you in long term. ie, if after some time if you want you can even change the entire hardware and its APIs without your clients even knowing it. Only thing you will have to do is to change the interface on the server accordingly.
greatest thing is to do wot others think you cant suhredayan@omniquad.com
|
|
|
|
|
Thanks for the reply.
As i mentioned the client side siftware is ready now. i.e if i install the software in any machine making the hardware public, i can talk to the hardware.Now i have to make the same software work when i have 2 networks. Is there any way i can write some code at server so that the same software can be used at any client machine ? I do not want to re write all the hardware API's for the server. In otherwords, how can i do the action of a API called on a client machine in the hardware through a server???
Shashi
|
|
|
|
|
Hello,
I am trying to use the waitable timer in a MFC project and using MsgWaitForMultipleObjectsEx() to wait
on the timer handle. But my timer callback doesnot get executed. Below is the source code with all
the error checking removed. Please help me to fix this problem.
OS Version: Windows 2000
VC Version: 6.0
//Globals
int wLoopCount= 0;
void CTimerTestDlg::OnStartTimer()
{
HANDLE hTimer[1];
LARGE_INTEGER liDueTime;
int breakLoop = 0;
int retVal = 0;
// Create waitable timer
hTimer[0] = CreateWaitableTimer(NULL, TRUE, "WaitableTimer");
// start the timer 5 sec from now and tick every 2 sec
liDueTime.QuadPart = -50000000;
SetWaitableTimer(hTimer[0], &liDueTime, 2000, TimerProc, NULL, 0);
wLoopCount = 0;
while (breakLoop == 0) {
retVal = MsgWaitForMultipleObjectsEx(1, hTimer, INFINITE, QS_ALLEVENTS, MWMO_ALERTABLE );
switch (retVal) {
case WAIT_OBJECT_0:
if (wLoopCount == 100) {
CancelWaitableTimer(hTimer[0]);
breakLoop = 1;
}
break;
}
}
CloseHandle (hTimer[0]);
return;
}
VOID CALLBACK TimerProc(LPVOID lpArg, DWORD dwTimerLowValue, DWORD dwTimerHighValue)
{
wLoopCount++;
}
|
|
|
|
|
In your code, why are you calling MsgWaitForMultipleObjectsEx() and not MsgWaitForMultipleObjects()?
One solution is a timer queue timer.
CreateTimerQueueTimer()
Kuphryn
|
|
|
|
|
Howdy,
I have an application that uses CDHtmlDialog. I'd like to display ActiveX objects on the dialog. The problem is that if the user doesn't permit ActiveX on Internet Explorer, then I can't use them on CDHtmlDialog either.
I've played with using GetOptionKeyPath, but the security options seem to be set in the registry in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings rather than in the key for IE.
Is there a way to display ActiveX objects in CDHtmlDialog without gettings warnings based on the IE options?
|
|
|
|
|
Is there any way to just change the alignment of header part only?
I want to make field name to be centered and rest of items to be right
justified. I try to use headerctrl to change the alignment, but
always change the alignment for a columns
CHeaderCtrl* pHeaderCtrl = m_GroupList.GetHeaderCtrl();
if (pHeaderCtrl)
{
HDITEM hdi;
char buffer[256]="ddd";
hdi.mask = HDI_TEXT|HDI_FORMAT;
hdi.pszText = buffer;
hdi.cchTextMax = 256;
hdi.fmt = HDF_CENTER | HDF_STRING;
pHeaderCtrl->SetItem(0, &hdi);
}
this will make the first column all centered.
I don't know why?
|
|
|
|
|
All,
I'm trying to do basic file I/O within the main dialog routine, the routine that all the GUI window notifications (WM_TIMER, etc.) are sent to. Is this allowed? The reason I ask is because when I try running the code I get a "Debug Assertion Failure" that states:
File: fprintf
Line: 56
Expression: Str != NULL
I'm pretty new to Visual C++ so it may be that I just can't do file I/O there...
Robert
|
|
|
|
|
When I go into the debugger the first argument to fprintf *str is apparently null. But, I don't open the file until a button on the GUI is pressed. The file name is based on the time that the button is hit. After opening the file I call SetTimer to fire every second at which time I try to write to the file. So, I wouldn't think that I would be writing to the file until the global variable FileOut2 gets set...
|
|
|
|
|
So what happens first, fopen() or fprintf() ?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|