|
Read up on LBS_USETABSTOPS and LB_SETTABSTOPS .
--
Dad, how strange it is that the pig can speak. *thoughtful pause* It must have lost its "oink". (my 3-year old daughter Moa, while watching Babe)
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. (Douglas Adams)
|
|
|
|
|
do this :
sockaddr_in ReceiverAddr;
ReceiverAddr.sin_addr.s_addr = ADDR_ANY;
TOXCCT alias Nicolas C.
|
|
|
|
|
Okay....let's say I want to give the recipient IP address as "172.20.144.50". How do I include this statement in the program?
The program is as follows:
#include <winsock2.h>
#include <stdio.h>
void main(int argc, char **argv)
{
WSADATA wsaData;
SOCKET SendingSocket;
SOCKADDR_IN ReceiverAddr;
int Port = 5150;
int Ret;
if (argc <= 1)
{
printf("USAGE: udpsender <receiver ip="" address="">.\n");
return;
}
// Initialize Winsock version 2.2
if ((Ret = WSAStartup(MAKEWORD(2,2), &wsaData)) != 0)
{
// NOTE: Since Winsock failed to load we cannot use WSAGetLastError
// to determine the error code as is normally done when a Winsock
// API fails. We have to report the return status of the function.
printf("ERROR: WSAStartup failed with error %d\n", Ret);
return;
}
// Create a new socket to receive datagrams on.
if ((SendingSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP))
== INVALID_SOCKET)
{
printf("ERROR: socket failed with error %d\n", WSAGetLastError());
WSACleanup();
return;
}
// Setup a SOCKADDR_IN structure that will identify who we
// will send datagrams to. For demonstration purposes, let's
// assume our receiver's IP address is 136.149.3.29 and waits
// for datagrams on port 5150. Obviously you will want to prompt
// the user for an IP address and port number and fill these
// fields in with the data from the user.
ReceiverAddr.sin_family = AF_INET;
ReceiverAddr.sin_port = htons(Port);
ReceiverAddr.sin_addr.s_addr = inet_addr(argv[1]);
|
|
|
|
|
you said it... if the address is given through the command line, that's this :
ReceiverAddr.sin_addr.s_addr = inet_addr(argv[1]);
assuming the IP is a correct adress...
TOXCCT alias Nicolas C.
|
|
|
|
|
I want to tell the program the receipient IP address....if not the program will not work.....it will execute till the printf statement " USAGE: udpsender <receiver ip="" address="">."
I have yet to modify the program with the IP address I want it to be.....
The rest of the statement won't be executed....
Also I need to put in the receipient IP address 172.20.145.45 so that I can transfer data from one PC to the other PC.....
I cannot just assume the IP is correct....
|
|
|
|
|
Actually i am developing a class in which it will take any com object and will be able to set and get the properties. Now i have taken the clsid of the component. Now how can i get its properties as GetIdsofNames function of IDispatch takes names. Please Guide me briefly with a little example or tell me some article
Thanx in advance
Regards
minamkhan
Inam
|
|
|
|
|
I am writing a program that interfaces with Flight Sim 2002 and 2004. I am writing this in .NET VC++ 7. I have one 100ms timer, and I am currently testing the program with only one funtion call. Every 100ms if a few variables are met the program accelerates the aircraft (writes a new velocity value to FS). That's the theory... in reality it only writes about once every 2-3 seconds or so. How can I make the program run faster, at a higher cpu priority, or whatever?
James Meade
vLT(jg) vUSN
vOPSOFF VAQ-140
|
|
|
|
|
Is the timer actually firing every 100ms? I'm not sure of the answer but if the timer is at fault you may try using a mm timer instead of the standard WM_TIMER..
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
The timer fires fine when it is the only program running. When it has to share processor space with Flight Sim it fires UBER slow. It isn't flight sim or my pc because other add ons and program seem to respond normally. It has to be the default priority .NET assigns the program, which has to be LOW.
James Meade
vLT(jg) vUSN
vOPSOFF VAQ-140
|
|
|
|
|
The mm timer doesn't rely on Window Messages, I believe it's more hardware orented. Being that the system is busy with the Sim program windows may be dropping the WM_TIMER messages... I would consider looking into using the mm timer instead.. I have some used it in app's where the timer portion is critical..
You can find samples here on cp and on codeguru.. If you have any problems i can post some of my code..
(only bad thing is my examples are in VC++ 6.0 not .NET)
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Anyone can tell me when I already insert the PrinterPort.h and PrinterPort.cpp in the project.If I want to use the CONTROL PORT as my output similar with DATA PORT how I write the code as it can function like DATA PORT?
Thank You
|
|
|
|
|
Long back i had used some api to convert the file size in bytes in terms of KB,MB, etc
does any one remember that api.
Thanx in advance.
Regards,
Toughest Steel Comes From Hottest Furnance
|
|
|
|
|
//Replace NULL with a pointer to a variable that holds the high-order size
//if the file is larger than can be represented by a DWORD
DWORD bSize;
DWORD kSize;
DWORD mSize;
bSize = GetFileSize(hMyFile, NULL);
kSize = bSize/1024;
mSize = kSize/1024;
Sorry; couldn't find anything else.
Heard in Bullhead City - "You haven't lost your girl - you've just lost your turn..." [sigh] So true...
|
|
|
|
|
humm, thanx any way for replying actualy this is not what i was looking for,
suppose x = 1025
then there is a function which gives the following ouput
CString t = somefunction(x); //t = "1 KB"
any way i made that function myself that does that.
Toughest Steel Comes From Hottest Furnance
|
|
|
|
|
StrFormatByteSize. Defined in shlwapi.h and requires linking to shlwapi.lib.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
I figured that, but having checked the Win32 functions, MFC reference, and run-time reference and finding nothing, I gave up. I should have just looked in MSDN[^], though actually finding anything there is often a challenge.
Heard in Bullhead City - "You haven't lost your girl - you've just lost your turn..." [sigh] So true...
|
|
|
|
|
I'm trying to retrieve information through software about the system's chipset. Things like the brand, model#, revision# etc...
Would somebody be able to point me in the right direction?
Thanks heaps!
|
|
|
|
|
Hey all
Just wondering if anyone knows of an "easy" way to get the computer's HOST name? (The host name of the computer that is running the application?)
Thanks!
|
|
|
|
|
ummm...how about GetComputerName() ?
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Go Pete! W00t!!!
Heard in Bullhead City - "You haven't lost your girl - you've just lost your turn..." [sigh] So true...
|
|
|
|
|
*Pete takes a bow toward his admiring fans*
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
I've been reading a handy book I bought a while ago, but never got around to opening, called Microsoft Windows 2000 API SuperBible. It obviously was never a best seller, as I got it for $15 on the discount shelf, but it's full of thousands of API descriptions and examples in C++. Neat stuff I can get into real mischief with, like BlockInput(TRUE) and ExitWindowsEx(EWX_FORCE, NULL). It even identifies which OS versions (Win2K or Win9x) each call applies to, and points out usage differences if they exist.
Now that WinXP is the OS of the week, to what extent does XP add to, or invalidate the Win32 API that was current as of Win2K?
Heard in Bullhead City - "You haven't lost your girl - you've just lost your turn..." [sigh] So true...
|
|
|
|
|
Hi!
I think it maybe a question difficult to answer. But I hope there are some people share the same experience with me will give me some hint.
I find one dll project very weird.
There are some functions in the dll to be export. They are declare with _declspec(dllexport).
But some function(about 5%) can't be find in the generated dll. (I used ultraedit to search for the name in the dll binary)
I finally find out it have some relation to its parameter. for example
int funcNoUse(long lRegionID)
{
return 0;
}
will be ok, it's generated in the dll.
But if i change it to
int funcNoUse(long lRegionID, long nPoints, float* pY, LPCTSTR szFlags, int makeCopy)
{
return 0;
}
it will not exist in the dll.
I really don't know what's up. I have test it on two computer one with VS7 and another with VS7.1 have the same result.
any idea?
|
|
|
|
|
Sounds like you be being a victim of "Name mangling". This is something the C++ compiler does so that overloaded functions with the same name but different parameters can be properly resolved by the linker. You can force the compiler to turn of "Name mangling" for a specific function by using extern "C" in the function declaration.
extern "C" int funcNoUse(long lRegionID, long nPoints, float* pY, LPCTSTR szFlags, int makeCopy)
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
hi ,
Iam new to VC++
iam having a class class CCommPort2 : public CObject ,now iwant to create same class like class CCommPort:public CObjectwith the same feautures
is it possible,iam getting errors pls let me know.
|
|
|
|