|
Hi all. I´m trying to use the API method SetWindowTheme() to completly ride my application from XP theme. My application has custom caption bar and border, and it looks strange when the XP theme is set. But nothing happens when I call this method.
My code:
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
...
SetWindowTheme(this->m_hWnd, NULL, NULL );
return 0;
}
This should work? Please, anyone can help me?
|
|
|
|
|
From the docs:When pszSubAppName and pszSubIdList are NULL, the theme manager removes the previously applied associations. To prevent visual styles from being applied to a specified window, pass an empty string, (L""), which will not match any section entries.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Thanks very much.
|
|
|
|
|
I have class A:CWinApp then call many dialog.Domodal() without main windows.Because we not assign value for m_pMainWnd so that dialog is no longer modal dialog.
|
|
|
|
|
You can't have more than one modal dialog at a time; that's what it means for a dialog to be modal. It takes over the message loop for the application while it is displayed, and control doesn't return to the primary window until the modal dialog closes.
If you want to have multiple dialogs opened simultaneously by an application, you will need to make them modeless. Instead of calling DoModal() , call Create() and ShowWindow() .
Software Zen: delete this;
|
|
|
|
|
hi,
I have ,say N=4 and r=3, i want to display all combinations of Ncr.....
i.e
123
234
341
421...etc
There should not any repition like 123..321..231..etc..it should display only one .......
thanks before..
James
-- modified at 13:48 Saturday 18th February, 2006
|
|
|
|
|
|
To print All the combinations of N elements with r combinations.......
-- modified at 14:24 Saturday 18th February, 2006
|
|
|
|
|
http://www.codeproject.com/cpp/CombC.asp[^]
First google, then "codeproject" then ask in a forum. My google search string was "C++ choose r from n combination algorithm" - and the 1st hit was the above link. Searching on google is an art - and forums are there when that art fails (which it does sometimes).
Koushik Biswas
|
|
|
|
|
hi
I need to write a program in VC++ using MFC sockets(CAsyncSocket) which give a list of all the nodes on LAN. I am able to get IP Addresses of all the connected nodes. but how to get the node names, for e.g. node19. Is it related to DHCP somehow. I don't know anything about DHCP right now.
Its really urgent.
please reply soon.
|
|
|
|
|
If you have the IP addresses, then you should be able to use getnameinfo().
Description on MSDN website: the getnameinfo function provides name resolution from an address to the host name.
You can take this link[^] to the documentation.
Hope this helps,
Dan
Remember kids, we're trained professionals. Don't try this at home!
|
|
|
|
|
Thanx Dan,
I have tried it but it gives the following error:
error C2065: 'getnameinfo' : undeclared identifier
Complete code of the .cpp file is :
<br />
<br />
#include "stdafx.h"<br />
#include "th1.h"<br />
#include "SockOLN.h"<br />
#include "OnLineNodes.h"<br />
<br />
#ifdef _DEBUG<br />
#define new DEBUG_NEW<br />
#undef THIS_FILE<br />
static char THIS_FILE[] = __FILE__;<br />
#endif<br />
<br />
CSockOLN::CSockOLN()<br />
{<br />
}<br />
<br />
CSockOLN::~CSockOLN()<br />
{<br />
}<br />
<br />
#if 0<br />
BEGIN_MESSAGE_MAP(CSockOLN, CAsyncSocket)<br />
END_MESSAGE_MAP()<br />
#endif // 0<br />
<br />
void CSockOLN::OnConnect(int nErrorCode) <br />
{<br />
AfxMessageBox("Connected");<br />
int i,pos1,pos2;<br />
BYTE a1,a2,a3,a4;<br />
struct sockaddr_in s;<br />
struct in_addr ad;<br />
char* hostn,*sern;<br />
CString st;<br />
UINT po;<br />
GetPeerName(st,po);<br />
s.sin_family = AF_INET;<br />
pos1=st.Find('.',0); <br />
a1=atoi((LPCTSTR)st.Left(pos1));<br />
pos2=st.Find('.',pos1+1); <br />
a2=atoi((LPCTSTR)st.Mid(pos1+1,pos2));<br />
pos1=st.Find('.',pos2+1); <br />
a3=atoi((LPCTSTR)st.Mid(pos2+1,pos1));<br />
pos2=st.Find('.',pos1+1); <br />
a4=atoi((LPCTSTR)st.Mid(pos1+1,pos2));<br />
ad.S_un.S_un_b.s_b1 =a1;<br />
ad.S_un.S_un_b.s_b2 =a2;<br />
ad.S_un.S_un_b.s_b3 =a3;<br />
ad.S_un.S_un_b.s_b4 =a4;<br />
s.sin_addr = ad;<br />
s.sin_port = po;<br />
hostn=new char[20];<br />
sern=new char[20];<br />
getnameinfo(&s,sizeof(s),hostn,20,sern,20,NI_NAMEREQD);<br />
((COnLineNodes*)DialPar)->m_List.AddString(st);<br />
((COnLineNodes*)DialPar)->m_List.AddString(hostn);<br />
Close();<br />
CAsyncSocket::OnConnect(nErrorCode);<br />
}<br />
<br />
void CSockOLN::listen()<br />
{<br />
Create(3000);<br />
Listen();<br />
}<br />
<br />
void CSockOLN::OnAccept(int nErrorCode) <br />
{<br />
AfxMessageBox("Connection Accepted");<br />
CAsyncSocket::OnAccept(nErrorCode);<br />
}<br />
<br />
void CSockOLN::SetSockPar(CDialog *d)<br />
{<br />
DialPar=d;<br />
}<br />
<br />
kindly reply soon.
|
|
|
|
|
rohini sharma wrote: error C2065: 'getnameinfo' : undeclared identifier
That suggests that you failed to include the needed header files. The documentation says:
Requirements
Client
Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95.
Server
Requires Windows Server "Longhorn", Windows Server 2003, Windows 2000 Server, or Windows NT Server.
Header
Declared in Ws2tcpip.h.
Declared in Wspiapi.h on Windows 2000, Windows NT, and Windows Me/98/95.
DLL
Requires Ws2_32.dll.
Unicode
Implemented as GetNameInfoW (Unicode) and GetNameInfoA (ANSI).
Are you sure you've included the proper headers for this function? If you include the headers and the compiler still complains about an 'undeclared identifier', then you could be working with an older version of the SDK that simply didn't include this definition.
Regards,
Dan
Remember kids, we're trained professionals. Don't try this at home!
|
|
|
|
|
If i include "Wspiapi.h" it gives error on that line Ünable to open file Wspiapi.h
This project is same for client as well as server. I am working on Windows 2000 professional as well as WinXP Professional.
|
|
|
|
|
Search your development machine for those two header files (wspiapi.h and ws2tcpip.h). On my system they reside in C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE.
If they don't exist at all on your machine, then it's little wonder that the compiler can't find them. You will need to upgrade your development environment.
If they do exist, then you probably have an issue with the list of directories the compiler is searching to find them. For VC++ 6 I can get to that information by clicking [Tools] -> [Options] -> [Directories].
Regards,
Dan
Remember kids, we're trained professionals. Don't try this at home!
|
|
|
|
|
My project needs to recognize two different file types(different extention name).How to set file filter to make file dialog showing two file type with that kind of extention name? My IDE is Visual C++ 6.0 with SP6.
Thanks in advance.
Best,
xyhan
|
|
|
|
|
See here.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Some programs shows a messages on top of systray when some new updates are ready . How to show such an update message.
Thanks in advance
Take Care
|
|
|
|
|
|
Thanks for helping out
Take Care
-- modified at 18:35 Friday 24th February, 2006
|
|
|
|
|
Hello,
How can I change a hard-coded variable from another program with my program ?
For example:
Program A has this definition:
CString strTmp = "This is a Test";
somewhere in it's code.
And now I want with my program to change this variable to "This is another Test".
How could I realize this ?
With best regards,
Benedikt
|
|
|
|
|
You can open the file (as binary) with Visual Studio and search for the string literal. You can't, however, make it any longer.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hello,
First off one quick question ... with the simplicity of scripts why go thru all the trouble to change hard coded varibles? A simple text file and a text parser is like magic sometimes
But as for changing hard coded variables, maybe putting the variable on its own thread and using a mutex would work. Or alternatively you could make one program take key input then use Shell Extensions to run that program inside another program and give it input from the second program.
Just a couple of random, probably nonsensical ideas, hope that helps
Jay
|
|
|
|
|
How to create program for linux
|
|
|
|
|