|
Thanks, but it's already installed and there's no native.h, unfortunately.
|
|
|
|
|
|
Right, I'm aware of the dropping of J++ in favor of all the .NET technologies. Just a PITA to have to compile old code dependent on this stuff.
|
|
|
|
|
I create 2 UDP sock ,
a server sock s:
a.sin_family=AF_INET;
a.sin_addr.s_addr=0;
a.sin_port=htons(5050);
bind(s,(sockaddr *)&a,sizeof(sockaddr_in));
a client sock c:
addrto.sin_family=AF_INET;
addrto.sin_addr.s_addr=INADDR_BROADCAST;
addrto.sin_port=htons(5050);
int ret=sendto(s,smsg,256,0,(sockaddr*)&addrto,nlen);
but I can set any address and port that is pass to recvfrom () and recvfrom can receive data from client.;
so recvfrom do not use the parameter address and port ?
see below:
from.sin_family=AF_INET;
from.sin_addr.s_addr=inet_addr("198.24.125.14")//any address;
from.sin_port=htons(5455)//any port;
recvfrom(s,buf,256,0,(struct sockaddr FAR *)&from,(int FAR *)&fromlength);
|
|
|
|
|
Hi,
I have a SDI application
When I click to run
I would like to know how to take parameters from command line running.
I mean I want to be able to run my application by DOS like this:
> MyApp -x -a
and get the parameters inside the application and pass it to SDI application.
Pls help me!
Many Thanks
-- modified at 21:40 Tuesday 28th February, 2006
|
|
|
|
|
you can use the function GetCommandLine() from any where in the application to get the command line parameters
nave
|
|
|
|
|
Another option is ParseCommandLine(...) which takes a CCommandLineInfo object as an argument.
For advanced parsing derive a class from CCommandLineInfo and override ParseParam to handle new flags.
Nibu thomas
Software Developer
|
|
|
|
|
is it possible to use server sock without any port appointed?
|
|
|
|
|
derek7 wrote: is it possible to use server sock without any port appointed?
Server listens for connections so hence it should be bound to a port.
Nibu thomas
Software Developer
|
|
|
|
|
Yes it is. If you call bind() with a port number of 0 (zero), the system will choose a port for you, and you can use getsockname() to find out which port it was bound to.
This is generally not very useful, because you still need to inform the client what the port number is somehow.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Sir,
I am working on VC++ for a simulation project.
i want to know for what most of the Reasons
Applications developed in VC++ will Crash.
and how to find the crash point for that Application i.e;
how to get into that particular line of code where my application has crashed.
Thank you
Sir
I Belong To The Almighty.
|
|
|
|
|
To find the line whre your application crashes you can find out if you build your app in debug mode. At tis time your system will start your debugger at the line your code crashes. But sometimes application crashes only in release therefore you have to insert some debug messages into your code for example Beep or MessageBox. Most crash's causes of not initialized variables therefore you have to initialize all members with valid values.
|
|
|
|
|
E.Satish wrote: how to get into that particular line of code where my application has crashed.
see this link http://www.codeproject.com/debug/mapfile.asp[^]
using MAP files you can find the line where the crash occured...the only downside being for large projects MAP file generated will be huge
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
Why bother using a MAP file? Just build the application with debug info (not a debug build, a release build with debug info). In fact the first changes I make to every project I make is to turn on .PDB generation for release builds.
Steve
|
|
|
|
|
Hello everyone...
Is there a way to give a piece of code exclusive access to the CPU without fear of interruption from Windows?
Something similar to a critical section, but across processes -- not just threads. And in user space... not kernel level or anything. If not, I imagine it's for stability reasons... but I figured there'd at least be *something*.
Any help would be very appreciated... thanks!
- Som
(I posted this in the Visual C++ because I'm using C to program this...)
|
|
|
|
|
No.
Since OS's uses protected mode a program cannot use the processor exclusive (this is not a windows behavior). The function EnterCriticalSection can be used to protect code from reentering in another thread not for exclusive execution on the processor.
|
|
|
|
|
No.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi,
You can try to increase your Thread priority. This sounds like the thing you wanted, but you have to be carefully though, because when doing this you could make the OS instable.
BOOL SetThreadPriority(
HANDLE hThread,
int nPriority
);
Where hThread is the handle of the thread and nPriority is one of the following values:
THREAD_PRIORITY_TIME_CRITICAL<br />
THREAD_PRIORITY_HIGHEST<br />
THREAD_PRIORITY_ABOVE_NORMAL<br />
THREAD_PRIORITY_NORMAL<br />
THREAD_PRIORITY_BELOW_NORMAL<br />
THREAD_PRIORITY_LOWEST<br />
THREAD_PRIORITY_IDLE
codito ergo sum
|
|
|
|
|
what is different between them?
|
|
|
|
|
Use your SDK manual. I think DDX_Control subclasses the given control and DDX_Text exchanges the text.
|
|
|
|
|
what does subclasses mean? it mean use a subclass to override the base class?
|
|
|
|
|
Subclassing in this case is: to attach the control or window to a given class (for instance: CButton).
This class will handle all events for that window.
|
|
|
|
|
Is sub ab. of substitute?
|
|
|
|
|
i can get the code to compile just fine but when i go to launch my application i get an assertion error, i narrowed down the block of code that might be causing it but i also think i am not correctly writing the code to display the bitmap.
this block of code in my OnInitDialog function is where i get the problem from i think.
m_st1.GetClientRect( &rectStaticClient );
rectStaticClient.NormalizeRect();
m_size.cx=rectStaticClient.Size().cx;
m_size.cy=rectStaticClient.Size().cy;
m_size.cx = rectStaticClient.Width();
m_size.cy = rectStaticClient.Height();
m_st1.ClientToScreen( &rectStaticClient );
ScreenToClient( &rectStaticClient);
m_pt.x = rectStaticClient.left;
m_pt.y = rectStaticClient.top;
GetObject( m_hBmpNew , sizeof(BITMAP), &m_bmInfo );
VERIFY(m_hBmpOld = (HBITMAP)SelectObject(m_dcMem, m_hBmpNew ) );
offsetx= m_pt.x;
offsety=m_pt.y;
InvalidateRect(&rectStaticClient);
not really messed with graphics coding much before, if soemone could help me out with whats possibly going on i would really appreciate it.
|
|
|
|
|
The assert comes from the previous selected bitmap in your memory DC - 'm_hBmpOld' is null.
To display a bitmap you have to paint it OnPaint() not to select it to an DC (DisplayContext).
HDC mdc;<br />
HGDIOBJ obmp;<br />
BITMAP bmi;<br />
<br />
if(m_hbmp && GetObject(m_hbmp,sizeof(bmi),&bmi))<br />
{<br />
mdc = CreateCompatibleDC(hdc);<br />
obmp = SelectObject(mdc,m_hbmp);<br />
<br />
BitBlt(hdc,offsetx,offsety,bmi.biWidth,bmi.biHeight,mdc,0,0,SRCCOPY);<br />
<br />
SelectObject(mdc,obmp);<br />
DeleteDC(mdc);<br />
}
|
|
|
|