|
I am trying to make a keyinput dialog which can then send input to any Cwnd. I had seen a keyboard project on Cp but there was one problem that it could not enter things into a child of a child because it was within the dialog.
Thus I am exploring the Attachthreadinput myself. What I don't understand is if this dialog has the CWnd of the edit or ... in another running program through maybe WM_COPYDATA, do I really need the Attachthreadinput call? What if I just send WM_COPYDATA back and forth with the keys pressed? Would this be good?
If I want to use the attachthreadinput, where would I really put this? I want to be able to get to the nested CWnd inside a dialog or View.
Thanks.
|
|
|
|
|
When I use
ATD(number)
to connect another modem (use in HyperTerminal).
I can not send command to modem because it send command as data to another modem.
And how can I use AT command to switch modem to voice mode? Can I use 2 modem to talk together?
lenhan
|
|
|
|
|
How can I get an event when modem connect to internet?
I want to write a application that execute immediately after connect to Intenet.
lenhan
|
|
|
|
|
You have to use some socket programming.There are lots of articles in CP about it and you can find out how to connect to internet and some other things.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
'h' is always NULL!
Why!!
int main()
{
struct hostent *h;
char szName[255];
DWORD ulLen;
GetComputerName(szName,&ulLen);
h = gethostbyname(szName);
if(h == NULL)
exit(1);
printf("Host name : %s\n", h->h_name);
printf("IP Address : %s\n",inet_ntoa(*((struct in_addr *)h->h_addr)));
return 0;
}
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Try initializing Winsock first.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquín M López Muñoz wrote:
Try initializing Winsock first.
Nish
Oh, I don't know why she's
leaving, or where she's gonna go
I guess she's got her reasons but I just don't wanna know
'Cos for 24 years I've been living next door to Alice
24 years just waitin' for a chance
To tell her how I feel and maybe get a second glance
Now I gotta get used to not living next door to Alice
|
|
|
|
|
show me....
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Look at WSAStartup() in MSDN.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
|
Hey all
i've taken the CDialogBar class provided by MFC and changed it in hopes of removing the dialog resource dependance and using just the CControlBar's CWnd.
Here is my code so far:
stripped down version of CDialogBar::Create()
ASSERT(pParentWnd != NULL);
ASSERT(lpszTemplateName != NULL);
m_dwStyle = (nStyle & CBRS_ALL);
CreateDlg(lpszTemplateName, pParentWnd);
CRect rect;
GetWindowRect(&rect);
m_sizeDefault = rect.Size();
SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOACTIVATE|SWP_SHOWWINDOW);
I would like to scrap the Template dialog resource and just use the CControlBar, any ideas how I would do this...?
When I removed the call to CreateDlg with CreateWindow etc...SetWindowPos is asserting with a NULL pWindow?
How does this work for dialog though...?
I tried CWnd::Create() and ::CreateWindow, but didn't have much success, if any at all.
Perhaps someone could gimme some pointers cuz i'm really lost here and it's starting to frustrate me.
Thanx in advance.
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
How can I invoke-make the button be pressed, this Mode to Design-mode.
Let's say I Right click the mouse ,and want this action to take place.
Thanks Erez
|
|
|
|
|
I've been trying this for hours but I can't seem to get one main window to create and show another separate window at run time. ShowWindow() returns no error yet the new window still does not show. I'm very confused.
Would someone be so kind as to write up a small snippet of code in which one open window creates an opens a second detached window so I can see what exactly it is I'm missing.
I'm doing this in C only and using the base Win32 SDK and not MFC (which I won't even attempt until I understand how to effectively use the base Win32 SDK first).
I can understand if someone doesn't want to write up a litte piece of code but if all else fails can some one direct me towards a document or website that can? All the documentation I have thus far explain how to use single windows and unique dialogs but not multiple windows.
As well is there some macro I could use to print out debug statments (like what return values are without printing out a MessageBox() for everything? I apologize for my ignorance and stupidity and thank you all in advance.
Sean Cody (NullStream)
"Today is what ever I want it to mean."
- Beth Orton
|
|
|
|
|
For the CreateWindow problem, it would help to see your code.
For the trace, try OutputDebugString.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
I can send code upon request as the code to generate and show the 2 windows is larger than it is appropriate to post to this forum.
Sean Cody (NullStream)
"Today is what ever I want it to mean."
- Beth Orton
|
|
|
|
|
You might have a look at using SetWindowPos to see if that can make a difference - though you might have tried that already.
What OS are you using? I have noticed different behavior in this area re w9x and NT/w2k.
|
|
|
|
|
Windows XP and Visual Studio 6 SP5.
Ok. I think my problem is coming due to a misunderstanding of how things are supposed to work.
For any Win32 program you create a main window.
You have to programmatically add any controls you want to this window.
I was/is trying to create the main window yet fill it's contents with a dialog I made in the resource editor. Is this even possible?
Then I would create another window in the same fashion and it doesn't show.... ugh.
one day i'll see it.... but i don't think it will be today.
Sean Cody (NullStream)
"Today is what ever I want it to mean."
- Beth Orton
|
|
|
|
|
Well... how bout using CreateDialog? ed. (er, for the main window I mean)
Mind, I do think its possible to do what you are trying to do, just checking.
|
|
|
|
|
I just saw that myself.
Basically I have 2 windows. Window #1 is a configuration window which accepts parameters for how Window #2 will work. Window #2 is just going to be a clean window which will have a DirectDraw surface on which I can paint via the options in Window #1. Now when Window #1 launches Window #2 I want it to go away as Window #2 will become the main window. When Window #2 closes the application closes.
Is that too confusing?
Sean Cody (NullStream)
"Today is what ever I want it to mean."
- Beth Orton
|
|
|
|
|
I'd make the DD window (#2) the main one - possibly with just the WS_POPUP style set.
At launch, show the config dialog first - DoModal would be easiest - then all you need to do is make sure it obscures the main one completely. If you want to ShowWindow(SW_HIDE) hide the main one, might have to make it a modeless dialog.
You might even be able to get away with a create dialog in WinMain, or a well posted message to the main wind before WinMain exits (caught before the DD wind gets a chance to paint itself), but I'd have to experiment with that.
|
|
|
|
|
Oops - as usual, just saw the flaws in that previous reply...
DoModal is the MFC for DialogBox, and I was wrong to use the phrase 'before WinMain exits' - what I meant was before WinMain fires up the main message pump.
DialogBox will execute its own message pump, so I think you can call it from WinMain - you will probably want to have a separate dialog proc for it though.
|
|
|
|
|
Hello!
I need to do RESUME for FTP file download using WinInet.
I am doing:
FtpCommand(FtpCon, // WinInet Connection handle
false,
FTP_TRANSFER_TYPE_BINARY,
_T("REST 111000"),
0,
NULL);
FtpCommand(FtpCon, // WinInet Connection handle
true,
FTP_TRANSFER_TYPE_BINARY,
_T("RETR test.txt"),
0,
&pFTPFile);
InternetReadFile(pFTPFile, ....);
But InternetReadFile reads the file from the very first byte. What I
am doing wrong?
Oleg Chebotar
Oleg Chebotar
|
|
|
|
|
The server needs to support streaming restart. If it doesn't, it will perhaps default to sending the whole thing (not sure what the RFC says on this). It might also support block restart, but there probably aren't 111000 blocks in file (er, just a guess).
Do you know for sure the server supports restart?
|
|
|
|
|
Yes server support restart command.
What should be the block size? I set block size in the InternetReadFile command to 2048.
|
|
|
|
|
there're so many strange file types in writting vc programs,like .tlb,.lib and .inl,etc.what's the function of them?And what's the relation between .lib,.tlb and .dll?
God blessing me...
|
|
|
|