|
I really need to know how to get a handle or a pointer to a child view?
I'm trying to do thar with GetWindow(), but how do I know which window the result is?
Thanks for all your help
/DrZOO
|
|
|
|
|
I think you can get the caption of all windows like this. I'm sure there is an easier way.
HWND curHWnd = GetWindow(HWND, GW_HWNDFIRST)
while (curHWnd)
{
int iLen = GetWindowTextLength(curHWnd)
GetWindowText(curHWnd , szWindowText, lngLen + 1)
// check if szWindowText is the Caption you want
curHWnd = GetWindow(curHWnd, GW_HWNDNEXT)
}
QMuffs
|
|
|
|
|
if you have the splitter wnd, you can do : splitter.GetPane(...) for each of the panes. this gievs you the CWnd for each sub-view.
-c
ABSURDITY:
A statement or belief manifestly inconsistent with one's own opinion.
|
|
|
|
|
It's nice with bright people!
|
|
|
|
|
Here's the code, it inside my WindowProc procedure:
LV_DISPINFO *pLvdi = (LV_DISPINFO *)lParam;
switch(pLvdi->hdr.code)
{
case LVN_COLUMNCLICK:
IntBox(1);
break;
}
When i run the program and the window isn't even displayed yet it comes with an "Unhandled exeption" and the goes into debug mode and goes to the "{" after the switch statement.
Thanks
|
|
|
|
|
is pLvdi NULL ? you should test.
-c
ABSURDITY:
A statement or belief manifestly inconsistent with one's own opinion.
|
|
|
|
|
Yes, it is... why that when i have set it to the value of lParam?
|
|
|
|
|
Aaah, i get it now, you have to check if uMsg equals WM_NOTIFY, thanks man.
|
|
|
|
|
I would like to have char * from string.
I have a fn. called c_str() but it returns a const char*, i dont want to cast away the constness. Whats the proper way to get the char* from std::string.
thanks
Kannan
|
|
|
|
|
std::string s won't allow you to directly manipulate the underlying char * (hence the const .) The closest you can get is obtaining a copy of it for your use. Example follows:
std::string s;
...
std::vector<char> v(s.begin(),s.end());
v.push_back('\0');
char *p=&v[0];
...
s.assign(p);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You really shouldn't try to do this. If you absolutely need a non-const char* then you should probably allocate a char array (ie. char szTemp[200] or char* pszTemp = (char*)malloc(200)) and copy the data from the std::string in and then reset the std::string when you are finished.
|
|
|
|
|
Hi,
In a dialog-based specific application, i need load, draw and change the pixel colors of both bmp and tiff images.
I don't know if it is possible for make a unified class such
as CDib class for dealing with both bmp and tiff images.
Would you please provide some info?
Thanks a lot!
chen
|
|
|
|
|
while i prefer my own library, there are a couple of image classes available on this site. Try the "Bitmaps and Palettes" section.
-c
ABSURDITY:
A statement or belief manifestly inconsistent with one's own opinion.
|
|
|
|
|
Hi!
Take a look at
http://www.6ixsoft.com/
They have a free "FreeImage" library.
Mukkie
|
|
|
|
|
I want my server ot transfer files...
But if my server is going to get data from client, send data to another client... and 10 clients do that at the same time.. pretty slow server huh?
So.. how can I solve it!?
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
Hi!
a) easy: you can't. Send it to two clients, those send it to another two? Or send the files on a remote server and tell teh clients the URL where thy can download the files. Have a look on different filesharing systems.
b) difficult: you have a multicast router, then you establish a multicast tunneling and use that to send a file to many target clients at the same time.
PS: I'm not sure if I'm right here. This is only what I found out.
|
|
|
|
|
I'm just looking for an easy way to send files from one client to another client. Those clients are connected to the same server.
If I do from client to server from server to another client... understand?
My server should be slow if 10 clients are sending files to another client... shouldn't it?
PS: Moak, for the last time! SIGN IN ON CODEPROJECT!
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
Hej Rickard,
I think you might tell me some more about your project/plans, what you wanna do in general. I'm slightly familiar with server programming and peer-to-peer filesharing systems (I wasted some time with Gnutella, hehe).
Transfering files from one client to another via the server costs the server (if serving many clients) a lot of traffic. I suggest do it peer by peer: once the clients know each other (e.g. exchange IPs via server), they can transfar data direct. For example IRC's DCC send does it that way (DCC=direct client to client) and all know filesharing systems like Napster, Gnutella, Fastrrack do the filetransfar itself direct peer to peer. Advantage: no man in the middle has to provide bandwith (fast), disadvantage: firewalled hosts or hosts behind a router (SNAT) can be a trouble.
But there are various ways around firewall troubles with file transfar: one un-firewalled host from two is enough, using SOCKS, using the IRC DCC protocol (which is routed through many known SNAT router) or as last chance do tunneling via a central server or a third (unfirewalled) peer.
Hope it helps, Moak
PS: Why signing up, is there any advantage? You can contact me anytime on www.p2pchat.org (IRC irc.p2pchat.org) any you have my mail.
|
|
|
|
|
mail me when you have a finished beta version
happy weekend
|
|
|
|
|
Hi!
I'm writing a simple dialog based application (MFC - Visual C++ 6), and it requires a large number of controls to appear on the same dialog. It will be running on Win98.
It compiles ok, and when ran on a WinXP machine it works fine. However, when ran on a Win98 machine, only the first 14 controls (as set out in .rc file) appear.
Anyone have any ideas about what this could be?
Martin
|
|
|
|
|
I know this probably isn't much help but I know I have read some where that you can only have x number of windows on a 9x machine.. and each control counts as a window.. I'm sorry but I dont remember the number.. You may do some searching on MSDN..
Rob
|
|
|
|
|
There is a limit of 255 (256?) controls on a dialog resource. WinXP may not have this limit, but I have definitely run into it on Win9X.
How many controls are there on your dialog total?
When I have encountered this problem before it did various things on Win9X. On certain versions it would not display the dialog, on others it displayed all but some of the controls and on others it blew up.
|
|
|
|
|
Yeah, my problem seems similar to the one you had. Only 14 controls are appearing (excluding the actual dialog). [Are visual basic controls not affected by this limit? Because I have written this program in VB before and it works ok.]
So how do I get round this problem. Do I need to design my dialog?
Martin
|
|
|
|
|
If I recall correctly, the 254 limit does not apply to VB because of the way it generates its forms. The solution to my problem was to write my own dialog editor and display engine. That's probably overkill for you. You can 1) redesign your dialog and break it into multiple resources and at run-time combine them. 2) you can use property sheets, 3) you can dynamically create your controls at run time.
|
|
|
|
|
Ahh! So I take it dynamically created controls are not included in the limit then? If so then that's great. But it really doesn't explain why only 14 of them are appearing (as opposed to the 254 limit)
Martin
|
|
|
|