|
Does anyone have a RELIABLE serial port class that uses messages for notification, etc. Thanks
Marcus
Make no little plans; they have no magic to stir your blood to action. Make big plans, aim high in work and hope
-- Daniel Burnham
|
|
|
|
|
Ramon de Klein's Serial library for C++ is very popluar here at CodeProject and meets your requirements.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I'm trying to get my program to send text to the edit box of another window.
I have no probelm getting the window's handle, and according to my "if" statements, its working.
this is what I have set up for my code while winvar is the variable for the window im sending text to:
::SendMessage(winvar, WM_SETTEXT, 0, (LPARAM)_T("text"));
Nothing appears in the windows edit box when I run the function, and it should be working according to my if statements.
|
|
|
|
|
|
When you do that, does it send the text to the title bar, or into the edit box?
I just tried the exact same code as you, and it changed the "Calculator" on the calculator window to "Hello World".
What I am trying to do is send text to the edit box... I'm not sure if that is the right name for it, so I'm going to say that i want to send text to the box that displays the numbers in the calculator window.
|
|
|
|
|
Try this then :- [it makes the title of calc "hello world" and the text box "chk"
void CTest_deleteDlg::OnButton1()
{
HWND hWnd;
::SendMessage(hWnd=::FindWindow(NULL,"Calculator"),
WM_SETTEXT,0,(LPARAM)"Hello World");
::EnumChildWindows(hWnd,EnumChildProc,0);
}
BOOL CALLBACK EnumChildProc( HWND hwnd,LPARAM lParam )
{
::SendMessage(hwnd,WM_SETTEXT,0,(LPARAM)"Chk");
return false;
}
My most recent CP article :-
A newbie's elementary guide to spawning processes
www.busterboy.org
|
|
|
|
|
|
I have a program that communicates to other computers on the network via a service.
I want to know how to determine a computers logon status. I.e whether it is logged on or not.
how do I know if a computer has not been logged on
|
|
|
|
|
Hi, I want to open a http connection, call an asp page, and read the response from that asp page. However, I need to go through a proxy to do this. Could someone show me actual code that would achieve this?? I have searched heaps and only found vague information on how to do it.
1. POST data to an asp page
2. receive the response from the asp page
3. must go through the proxy
Please help!! Thanks!
|
|
|
|
|
|
CHttpFile *s;
CHttpConnection *c;
CInternetSession *is;
if (useProxy)
is = new CInternetSession(NULL, 1, INTERNET_OPEN_TYPE_PROXY, ProxyURL);
else
is = new CInternetSession(NULL, 1, INTERNET_OPEN_TYPE_DIRECT);
c = is->GetHttpConnection("ip", (INTERNET_PORT) 4000);
wsprintf (param,"nickname=%s&password=%s&entranceRoom=%s",User,PassWd,RaumName);
wsprintf (length,"Content-Length: %d\r\n",strlen(param));
strcpy (header,hdrs2);
strcat (header,hdrs3);
strcat (header,hdrs4);
strcat (header,length);
strcat (header,hdrs5);
wsprintf(rline, "/Login.html");
s = c->OpenRequest("POST",rline,referer,0,NULL,"HTTP/1.1",INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_RELOAD);
LPCTSTR lpszHeaders = header;
s->SendRequest(lpszHeaders, strlen(header), param, strlen(param));
f = new fstream("back.html", ios::out);
while (s->ReadString(l) != FALSE)
{
... // some *f things
}
delete f;
s->Close();
delete s;
delete c;
delete is;
this is only a little example from my code ... not even perfect but its working.
u always have to check ur headers and the things that you send.
best way to check is a html browser and a packet sniffer. there are many outta there. with the sniffer u see the original header and data. and could also check your program that it send also the right one.
bye
|
|
|
|
|
i have made a program that uses a file format that i have created called *.sts and i need to make the file (when double clicked) open my program and load the file in?
|
|
|
|
|
|
Hi,
I have created a CPropertySheet modal window, and I'd like to be able to remove the OK, Cancel, Apply Now, and Help buttons but don't know how.
Please help me
Fabian
|
|
|
|
|
found something, no more help needed
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q141039
|
|
|
|
|
Has anyone gotten this to work? I keep getting script errors.
- Matt Newman
-Sonork ID: 100.11179:BestSnowman
Frankly AOL should stick to what it does best: Fooling millions of americans into believing that it, AOL, is the web. -Paul Watson
|
|
|
|
|
Consider the following 2 program code segments. Which one utilizes main memory more efficiently, and which one takes up more space in main memory for variables?
Code segment #1:
int score1, score2, score3;
.
.
Code segment #2:
int score[3];
.
.
Loli10
|
|
|
|
|
no difference in space. they will probably be allocated identically, too (three consecutive DWORDs)
-c
Smaller Animals Software, Inc.
You're the icing - on the cake - on the table - at my wake. Modest Mouse
|
|
|
|
|
Twice programs use the same memory size...
Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Told ya so...
|
|
|
|
|
I asked the following question today in a MSDN chat:
Alice_MS : Q: soliant : Are there going to be tests targeting C++.Net in the future ?
Alice_MS : A: Yes, there will be some coming later this year.
Just an FYI.
Soliant
|
|
|
|
|
I am very new to C++ and I was wondering how to go about printing graphics to the screen even just simple dots circle and lines !!
Can anybody help me ?
|
|
|
|
|
Create a message handler for your WM_PAINT message in the window that you want to draw on.
Inside WM_PAINT add this code assuming hWnd is the handle to your window:
PAINTSTRUCT ps;
HDC hdc;
hdc = ::BeginPaint(hWnd, &ps);
There are a number of functions that you can use to paint on the HDC handle that you have just created, lookup "device context [win32]" in msdn.
You would add these functions here. Here is an example of how to paint two lines and a circle.
// Set the initial pen position for the pen that will draw the line. When you create the DC,
// the default position is at (0,0).
::MoveToEx(hdc, 100, 100, NULL);
// Draw a horizontal line from the current position (100,100) to (200,100).
::LineTo(hdc, 200, 100);
// Draw a line at 45 degrees current position (200,100) to (300,200).
::LineTo(hdc, 200, 100);
// Draw a circle. The circle function does not depend on the current pen position.
::Ellipse(hdc, 100, 100, 200, 200);
Finally, in order to free the DC that you have created with BeginPaint, you must call EndPaint.
::EndPaint(hWnd, &ps);
After reading your message again, I am not sure if you are asking how to paint to the desktop. If so, instead of using BeginPaint in order to create your DC, use this call:
hdc = CreateDC("DISPLAY", NULL, NULL, NULL);
or
hdc = GetDC(NULL);
In either case, this will only create a DC to the primary monitor. If you are programming for a computer with multi-monitor support you will need to use EnumDisplayMonitors to determine which dirver to create the DC for.
Then you will need to use this function to release the DC:
::DeleteDC(hdc);
or
::ReleaseDC(NULL);
Depending on which function you used to allocate the DC.
|
|
|
|
|
If you're using the console ( which is how you should learn C++ before moving to Windows specific stuff ), then there is no real way to show graphics. If you're using MFC, then stop it now. Learn the basics of C++, class design, OO, and the standard library before getting to the Microsoft specific stuff. You'll be glad you did.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
|
|
|
|
|
|