|
Hi all. Do anyone know how to open two windows as soon as I open my application? One window is used to display some output during the running of the application and the other window is used for the user to open some image file. Does anyone know how to do this? Thank you.
|
|
|
|
|
Hi...
-----
If I understand your question (which I dont).
If you want your app to be with multi windows.
(*in you example 2 windows*)
You can call twice "CreateWindow(...)"
but then you use the same winproc
or
You can register 2 difrent classes for 2 diffrent window procs
and call "CreateWindow(...)" twice also,
but ONE for each registered class
=-=-=-=-=-=
The-Server
|
|
|
|
|
HI. Thank you for your reply. What I mean is that when I open my application, it will display two blank child windows (frames) instead of the usual one. Hope this is more clear.
|
|
|
|
|
I m very sorry...
But I dont understand what you want to do.
If you are talking about programming in VCPP.
Please let me know what are you talking about,
I m very intresting in your question...
Because I just dont understand it.
I have some question for you:
How many windows in total? (include the main one)
How many & what types if windows you have in total?
Also, How many times you need to call RegisterClass(...)
=-=-=-=-=-=
The-Server
|
|
|
|
|
Hi. thank you for your reply. I am using VC++ and mfc in my application. Usually if you create a MDI application, when you run the program, only one child frame or window is opened. What I wanted to do is that when my application is double clicked, it runs and two blank child windows should be opened instead of just one as in the normal case. So in total, I have the main window, and two child windows inside the main window. I tried using another CView class for the second child window but it did not work. I keep getting the error "COutputView (the class I created) is not a class or namespace name" and I do not know how to resolve it. Hope you understand now. Thank you.
|
|
|
|
|
Yes..
It took me some time,
But finally I get it.
Sorry to disapoint you,
But I didn't work with MFC since 1999...
It's about 4 years now.
=-=-=-=-=-=-
The-Server
|
|
|
|
|
In a CDialog I place and draw some controls, like buttons
by hands coordinating them in usual pixels.
With change of system font proportions of CDialog position and size of native CDialog controls changes not proportionally to
pixels... So Proportionality in sizes looses.
So Question is:
Which functions help to translate pixel coordinates
with system font change ?
thanks you
|
|
|
|
|
I don't know if this helps you directly, but you may have a look on this article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dngdi/html/highdpiapp.asp
|
|
|
|
|
I need to play two *.WAV files at the same time in my application - as in solitaire games - the first file is the background music and second sound file is played when the cards are moved (or similar events). Any idea how to do this? I'm trying with PlaySound() and a new thread, but nothing is happenning - maybe I can't set the flags properly or there is something else?
|
|
|
|
|
void StartPlayTwoSounds()
{
PlaySound("MyFirstSound.wav", NULL, SND_FILENAME | SND_ASYNC);
PlaySound("MySecondSound.wav", NULL, SND_FILENAME | SND_ASYNC);
}
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
|
|
|
|
|
It doesn't work man
In that order only second file is played, but not the first!
|
|
|
|
|
well guys i am tired of using CSocket and CAsyncSocket buggy MFC sockets classes.
It was biggest mistake i did when i started two huge projects using these classes .now these projects are complete but the problem is , it is giving satisfactory results but not really good(Normally after some communication CSocket becomes useless , so i have to close it and again establishing connection and it is due to buggy message pumping mechanism of these sockets)
so if any have some good implemention of WINSOCK , specially a class which could handle the event notification like OnRecieve , OnCLose as in CSocket , and almost the same public initerface as CSocket etc.
It will make it possible to streight away replace CSocket with new one and no change in my existing projects .
If some body could refer some tested code in this regard , i 'll be really thankfull to him.
No Worries!
|
|
|
|
|
How familiar with Winsock are you? I prefer writing your own class from scratch and implement the features you want and nothing else.
I'm doing this right now for a project in school.
But you can always try google
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
|
|
|
|
|
dit you have a look on CSocket...?;P
TOXCCT
|
|
|
|
|
What do you mean?
BTW, your name reminds me about Britney's latest video, Toxic! :drool:
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
|
|
|
|
|
well, there is a CSocket class in the Visual C++ library, and i thought you did watched it...
emm, for my name, it means The Toxic Dream, but that was too long to write so here is the "condensed shape"...
a last thing, excuse me for my very poor english, i do my best, but when you're french... it's not easy . I hope you understand me anyway... i think so
TOXCCT
|
|
|
|
|
In my experience, as far as client side is concerned, CSocket/ASyncSocket should never cause any trouble. Though i personally prefer CAsyncSocket over CSocket , to avoid blocking issues. As such CAsyncSocket requires special care[^].
If we talk about server side, it depends upon the scalability desired (i.e the maximum number of users you want to simultaneously connect) and throughput (Data flow rate into and out of server). If both the attributes are low CAysncSocket should work fine. Otherwise you may need to dig into WinSock API and I/O completion ports.
|
|
|
|
|
first of all i want to brief u about my project.
It is a Video streaming software , so almost 5 tp 20 k data is sent across sockets per sec.For this i am using sockets with CSocketFile and CArchive attatched to CSocket object that is why i cant use CAsyncSocket .
what happens that after on average 10 to 15 frames , data socket becomes usless in a sense that even server sends me data but on client side OnRecieve does not calls . and on server end Send does not returns any error code.so what happens in this condition i close socket and reconnect with server , although i do it transparent from user , but surely a kinda delay comes.
So now my question is it due to CSocket , blocking nature (although i can use CAsynSocket cauz i am doing synchronize communication) but due to CSocketFile and CArchive i am using it.
No Worries!
|
|
|
|
|
Hi, Im using the FindWindow() function to find an application called Fullscreen.exe and then sending a WM_CLOSE call to it. However I get this error:
nPOSDlg.cpp(367) : error C2440: '=' : cannot convert from 'class CWnd *' to 'struct HWND__ *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
nPOSDlg.cpp(374) : error C2660: 'SendMessageA' : function does not take 4 parameters
This is the code that I have put into my OnAppExit(); because I want it to kill Fullscreen.exe when nPOSdlg closes.
HWND hWnd;<br />
hWnd = FindWindow(NULL, TEXT("Fullscreen"));<br />
if(hWnd == NULL)<br />
{<br />
}<br />
else<br />
{<br />
SendMessage(hWnd, WM_CLOSE, 0, 0);<br />
}
How do I convert from CWnd to HWND or what do I need to do?
Please help, thanks!
Ashman
|
|
|
|
|
to keep things simple, just add :: before the FindWindow function, this will let you expelicitly use the HWND version.
|
|
|
|
|
Hi.
Can i know the return value of ReadFile when a timeout occurs, if the commtimeout structure was previously set?
I am writing a simple program that reads the serial port for characters arriving. Anyone can recommend a better option than the one i use?
Target device is WindowCE, using embedded Visual C++ 3.0
bool WaitForChar(unsigned char character,DWORD dwTimeout)
{
DWORD dwTimeStart,dwRead;
BYTE in[2];
dwTimeStart = GetTickCount();
while((GetTickCount() - dwTimeStart) < dwTimeout)
{
if(ReadFile(hPort,in,1,&dwRead,NULL))
{
if(dwRead != 0)
{
if(in == character)
return TRUE;
}
}
else
return FALSE;
}
return FALSE;
}
|
|
|
|
|
Hi...
What's the command to close a parent property sheet so that it's child pages are closed automatically also?
Thank you.
|
|
|
|
|
EndDialog() perhaps.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
plz give me example how to create web server with PHP and ASP page enabled.
donald
|
|
|
|
|
can you give example about implementing webserver using cgi
platform:windows2000
i've already try passing query_string using environment variable. i try it on command prompt. i use "set" command then query_string and variable name and its content.
then using syntax c:\php\php [php file where i wrote the script to display a $name variable] <[file location where i wantto redirect].
but i cannot do the same thing when i try to passing form data (POST method).
i've used command line winCGI-exe cgi-data-file. winCGI-exe is the complete file path to CGI prog exe like c:\php\php.exe
i've also completing cgi-data-file content.
it's consist of some sections like [CGI] section, [Form External] section,etc.
in [CGI] section i've wrote all the keywords like Request Protocol,Executable Path,etc. But again, it doesn't work. until once i met a line "input file not spesified" in command line of DOS after some http header,...PLZ help me!!!
NOTES: i found all the CGI specification on website with "Windows CGI Interface" keyword.
one of the author is Ken.Coar@Golux.Com and rdenny@dc3.com
donald
|
|
|
|