|
Hi,
I have the following code
WNDCLASS wc;
// Source window
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = NULL;//(WNDPROC)SourceWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;//UD_MAIN_WINDOW_EXTRA_BYTE;
wc.hInstance = A_hInst;
wc.hIcon = LoadIcon( A_hInst, MAKEINTRESOURCE(ICO_UMAXLOGO) );
wc.hCursor = LoadCursor( NULL, IDC_ARROW );
wc.hbrBackground = (HBRUSH) GetStockObject( LTGRAY_BRUSH );
wc.lpszMenuName = NULL;
wc.lpszClassName = kMAIN_WINDOW_CLASS; // define in TW_LAYOT.H
if( !RegisterClass( &wc ) )
return FALSE;
But RegisterClass() fails in windows 98.
Can anyone pl help me.
Neha
|
|
|
|
|
Apart from RegisterClassEx being a better function to use, what is the error returned from GetLastError when RegisterClass fails?
Michael
|
|
|
|
|
I have downloaded & unzipped the STLport library. There are several make files found.What needs to be done , so that I can start using it.
Thanks very much
|
|
|
|
|
The procedure differs depending on your compiler. There are several good .html docs in the /doc subdirectory of your STLPort directory. For example to build the STLPort for Visual C++ 6, you would go to a command prompt, run VCVARS32.bat to register the build evnironment variables, then run
nmake /f vc6.mak clean all
and watch it compile (takes a few minutes)
In order to use it, you would need to set it in your include search path BEFORE any other paths which would contain another STL implementation.
|
|
|
|
|
Hi,
Can Any one tell me how can i close one application from other one as i have the path of first application in the second application while sing registry....
Neo.
|
|
|
|
|
CWnd pwnd = FindWindow(LPCTSTR lpszClassName, LPCTSTR lpszWindowName );
PostMessage(pwnd->m_hWnd, WM_CLOSE, 0, 0);
You can find lpszClassName and lpszWindowName parameters of FindWindow() with the Spy++ utility from Visual Studio Tools
"Needless redundancy is the hobgoblin of software engineering." - Peter Darnell
|
|
|
|
|
... or WM_QUIT
Normski. - Professional Windows Programmer
|
|
|
|
|
Hi All,
I wanted to defines some BITMAP resources dynamically. If I wanted to display a pre-determined bitmap in my dialogbox, then I define a BITMAP resource and calling LoadBitmap() in pannel of that dialog-box. The defination in project.rc file goes like
IDB_USER_BITMAP BITMAP DISCARDABLE "images_1\\user-pannel.bmp"
What I wanted to achieve here is something like
#define PRODUCT_IMAGE_PATH "images_1"
IDB_USER_BITMAP BITMAP DISCARDABLE PRODUCT_IMAGE_PATH+"\\user-pannel.bmp"
Thus at compile time it decide about resource-id and which resource to incorporate.
I wanted this to make smaller size of my executable as well as eleminating manual task of folders renaming.
Thanks.
-- Sumit
Sumit Pandya
-- modified 1-Aug-19 21:02pm.
|
|
|
|
|
I've got a problem with the API "createipForwardEntry"). I'm trying to add a routing rule in the piece of code hereunder. It works just fine. However, if i use the IP address assigned to my ethernetcard as the "next hop" (thereby making it the default gateway for the particular network segment) it fails me. Can anyone help me out?
<br />
PMIB_IPFORWARDROW pRow = NULL;<br />
ULONG dwSize = 0;<br />
DWORD dwStatus = 0;<br />
<br />
pRow = (PMIB_IPFORWARDROW)malloc(sizeof(MIB_IPFORWARDROW));<br />
<br />
if (!pRow) {<br />
MessageBox("Malloc failed, Out of Memory!\r\n");<br />
exit(1);<br />
}<br />
<br />
pRow->dwForwardDest = inet_addr("172.0.0.0");<br />
pRow->dwForwardNextHop = inet_addr("172.31.64.9");
pRow->dwForwardMask = inet_addr("255.0.0.0");<br />
pRow->dwForwardIfIndex = 2;<br />
pRow->dwForwardType = 4;<br />
pRow->dwForwardProto = MIB_IPPROTO_NETMGMT;<br />
pRow->dwForwardAge = 0;<br />
pRow->dwForwardMetric1 = 30; <br />
<br />
dwStatus = createipForwardEntry(pRow);<br />
<br />
if (dwStatus == NO_ERROR)<br />
MessageBox("Route Added Successfully\n");<br />
else if (dwStatus == ERROR_INVALID_PARAMETER)<br />
MessageBox("Invalid Parameter\n");<br />
else <br />
DisplayErrorMessage(dwStatus);<br />
<br />
if (pRow)<br />
free(pRow); <br />
pretty please?
|
|
|
|
|
But it doesn't make sense to add a local network route loop like that!
Picture this:
Your local IP is 172.31.64.9, your local mask is (probably) 255.255.255.0.
That net config makes an implicit route: it tells IP that 172.31.64.0/24 is directly connected.
Picture adding your route command to that: route add 172.0.0.0 mask 255.0.0.0 172.31.64.9.
That route tells IP that the host 172.31.64.9 knows how to route to the whole of 172/8. But it doesn't! Your IP config tells windows that knows how to route to 172.31.64.0/24!
Basically, you can never set a gateway to local with an explicit route in IP.
The one big exception to this is if your route applied to a different IF.
I hope that makes some sense?!
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Actually, the interface which has 172.31.64.9 is a VPN interface (Intel Netstructure), getting a DHCP address every time a connection is set up. So the interface does know how to route 172.0.0.0. As I stated in my sourcecode sample "route add 172.0.0.0 mask 255.0.0.0 172.31.64.9 metric 50 if 2" work just fine. It does make sense.....
|
|
|
|
|
if 172.31.64.9 knows how to route to 172.0.0.0/24, then DHCP will have given a mask of 255.0.0.0 to go with that address. If it did, then yay, your routing works already. If it didn't then trying to manually make a route to that net on that interface won't work.
--- your manual route says that 172.31.64.9 can address the whole of 172.0.0.0
--- your DHCP assigned mask (eg. 255.255.255.0) doesn't agree, hence a conflict.
You can never specify explicit routing rules for local interfaces. IP knows how to route to these already, becuase of their netmask.
The above only applies if you have a single interface.
But, if your DHCP assigned address (172.31.64.9/255.255.255.0) came with a default gateway allocation (eg 172.31.64.254), then you can probably route the whole of 172.0.0.0 to that. eg "route add 172.0.0.0 mask 255.0.0.0 172.31.64.254". That would work.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
No offense, but the routing command i pasted there works like a charm; and besides, that wasn't my question, the question had to do with C++ and CreateIpForwardEntry.
Sorry.
|
|
|
|
|
I know that was your original question. My point is that perhaps CreateIpForwardEntry returns an error in those precise circumstances because the route you're trying to create is invalid!
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
I'm missing the point why it should fail. route.exe calls createIpForwardEntry as well (iphlpapi.dll) and from the commandline it works like a charm; I really see no reason why it should fail.
|
|
|
|
|
Is there anybody who knows how to program using the BHO(Browser helper obj)?
I've searched the www,but got no information except for those from MSDN.
|
|
|
|
|
I've done a little bit recently and got most of my info from MSDN, mainly the articles by Dino Esposito.
What is your question?
Michael
|
|
|
|
|
I'm making a client and server program. So far the server works great, but the client is having a little trouble. The problem is coming from 2 connection classes, which are both derived from CBaseSocket which is derived from CAsyncSocket.
One of the classes is CListen and the other is CMessage. CListen listens for a connection and CMessage sends messages to another client program.
Right now, CListen will receive a message from another client program through the socket that basically says "I want to send a message to you, reply please."
CListen then does this:
CBaseSocket *anothersocket;
if(message == "I want to send a message to you")
{
anothersocket = new CMessage();
}
SOCKET socktemp = Detach();
CString sendstring = "Ok, send the message on this socket!";
anothersocket->AttachToSocketAndSend(socktemp, sendstring);
The AttachToSocketAndSend function 'Attach's the CMessage object to the socket and then sends the message.
Basically I want this to transfer control of the socket to the CMessage object. I want the CMessage's OnReceive function to be triggered when the other client sends more data. My problem is that whenever data is received through the the socket, it gets routed to CListen's OnReceive() function (instead of CMessage's.. I want CMessage to handle the received data now)
Can anyone help?
|
|
|
|
|
Hello,
Is there a way to pass in the account name and password in the 12th and 13th parameters of CreateService, by obtaining them. My goal is to pass in the values when the computer is rebooted and the services automatically start.
Thank You
|
|
|
|
|
There is no way to get the password for an account, sorry. It'd be a security hole, and besides the actual passwords aren't stored anywhere, only their hashes.
--Mike--
"Why you keep calling me Jesús? I look Puerto Rican to you?"
-- Samuel L. Jackson in Die Hard 3
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
I have a multiple edit box on a Wizard and I have one problem...when the user clicks on Escape and the focus is on the multiline edit box, the dialog box doesn't close up. However, when I take the multiline property off, the Wizard is closed when I click ESC. In addition, when the foucs is on another single line edit box on the same property sheet, ESC works properly.
Any ideas why this might happen?
I have noticed that when I click on the Cancel button or the focus is on the single line edit box, the PropertyPage::OnReset() is called which eventually calls the OnCancel() function. However, this is not the same sequence that the multiple line edit box follows.
Would appreciate your help!
thanks
|
|
|
|
|
How can i make an app with ms agents compatibility in visual c++
|
|
|
|
|
The Microsoft Agent section of the Platform SDK contains a step by step guide for how to use MS Agent with C++.
Michael
|
|
|
|
|
I have an SDI app which is split into 4 views with 2 CSplitterWnds.
When I resize the internal windows I get a trace message saying 'Warning: Could not find splitter cursor - using system provided alternative.'
This is ok, because it still works and resizes and stuff, but some of the windows are not being redrawn when they should be.
Can anyone tell me how to intercept any messages or anything so I know when the windows are being resized and can call the redraw functions for my views?
I have searched MSDN and a fair few books and found nothing useful.
Thanks a lot people.
: Wherever you go, there you are, and you wish you were somewhere else :
|
|
|
|
|
*BUMP*
: Wherever you go, there you are, and you wish you were somewhere else :
|
|
|
|