|
Ramya, it seems you are trying to write a console application with windows-based programs' project settings.
ie,try Project -> Settings -> Link
and on the bottom box search for "/Subsystem:windows" and change it to
"/subsystem:console".
Im not sure tats the only one to be changed...
greatest thing is to do wot others think you cant suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
What kind of project have you selected?
or lookup for LNK2001 in the msdn. it would offer you some help and some additional knowledge to tackle this kind of problem.
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
Ramya Narayanaswamy wrote:
error LNK2001: unresolved external symbol _WinMain@16
See here.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Iam currently trying to write some file IO in visual c++ for a project iam on and I need to transport some number data (Integer & double) written in visual basic and then saved to a file. This data then needs to be read in by my visual c++ app. The problem iam having is that if I save the data as ascii text in VB then it is hard for VC to read the text in and put them into their correct types (ints & doubles).
I was considering using binary IO to write the data to file but iam unsure if a 16 bit integer or double would have the same representation in binary as it would in visual c++
Ideas anyone?
[] /\ () X
|
|
|
|
|
If you are planning on transporting the binary representation of these numbers across these development platform, not only will you need to ensure the correct binary format stored, but this still will not solve your problem of distinguishing between the integer and float (double) type.
I would suggest storing the numbers as a text value. You could then use a decimal digit to distinguish between wether your number should be treated as an integer or a float: eg:
If the following is stored in your text file:
"45,23,45.0,23.0"
Then you would infer that the first two numbers should be of type int, and the last two, of type double.
I Dream of Absolute Zero
|
|
|
|
|
I have an application that runs on our server that I can no longer get support for.
The application runs great for days at a time and then it crashes.
I would like to write a task manager type utility that would automatically cancel the application.
Can you point me in the right direction? C++ or C# code highly desired.
thanks
|
|
|
|
|
McGahanFL wrote:
I would like to write a task manager type utility that would automatically cancel the application
what is the need for closing the appliation by using an external program?
you can do that when your application crashes..use the try(){ } catch(..) in every method, then you can catch the exceptions when application carshes. in the catch(), just do whatever you want to do..just terminate your threads or kill your application itself..or even invoke an instance of your application etc..
The returned pointer may be temporary and should not be stored for later use.
|
|
|
|
|
Thanks for your reply. As I indicated, I do not own the program and therefore do not have the source. The vendor no longer seems to be in business.
Anyway, I found a regerstry setting.
thanks
|
|
|
|
|
If the application has crashed, what would be left to cancel?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
The system presents the admin with a doctor watson msgbox.
I got my answer, thanks
|
|
|
|
|
I have written a DLL which hooks different application on their thread
id.
Once the events are trapped in the dll , then the functions are
written separately to process the hooking in the dll.
But through out the dll , I have defined a static counter variable.
This is supposed to get modified in each of the trapping functions.
But it seems that the variable is not getting modified .
I need to pass the modified value to some other application using a
third function in the dll.
What should I do to ensure that the common variable is updatable from
all the Hook-processing functions
Thanks in anticipation
Rajesh
|
|
|
|
|
Place your static in a data segment like this.
#pragma data_seg (".StaticShare")
static unsigned int counter = 0;
#pragma data_seg ()
This assure that this variable will be available for all instance of your dll. You will have multi copy of your dll but only one data_seg (StaticShare).
P.S. you can name your data_seg the name you want.
Bye.
|
|
|
|
|
|
Hi, i wonder if anybody with knowledge of the TCP header can help me with this one:
I am casting some data from a buffer provided by the winpcap packet capture library into a struct I have defined to represent the TCP header, the header is at the start of the buffer and I am casting it like this:
<br />
tcpHeader = (tcp_header *) (UCHAR*) tempDatagram.pkt_data;
where the tcpHeader is of type:
<br />
typedef struct tcp_header{<br />
USHORT sport;
USHORT dport;
UINT32 seq;
UINT32 ack;
UINT x2:4;
UINT off:4;
UCHAR flags;
USHORT win;
USHORT crc;
USHORT urp;
} tcp_header;<br />
the cast is working upto the offset i think and then values are being filled in a little randomly from there so I dont think i have the tcp_header defined right for the TCP header, can anybody suggest how to fix it?
|
|
|
|
|
|
USHORT sport;
USHORT dport;
UINT32 seq;
UINT32 ack;
So far, so good. The next bit, according to "Internet Protocols Handbook," should be:
Data Offset - 4 bits
Reserved - 6 bits
Flags - 6 bits
I think I'd take the whole lot and make one 16-bit value of it, using ORs to set the flags and offset bitfields. Also, this reference indicates that a variable length Options field, padded by 0s in the low-order bits to 32-bits, is expected to precede the data block. The book doesn't mention whether the Options field is required; the RFC (793) may be more specific.
I've felt much better since I gave up hope.
|
|
|
|
|
Cheers for the reply roger,
Can you give me a hint at which data types would be best suited for these fields and how to declare them at that length in c++, considering that I would rather they were kept seperate from one another so no further processing is required to split the header data into component parts.
As you can tell I am a bit of a novice at c++ and the MFC's and i think i have bitten off a bit more than I can chew
|
|
|
|
|
packetlos wrote:
i think i have bitten off a bit more than I can chew
I think you're right, but I don't know any better way to learn and grow than to take on and accomplish a task that is beyond one's current capabilities.
As for data types, there really isn't anything in C++ that I know of that handles 6-bit fields efficiently, but I rather like 32-bit words, manipulated with logical bitwise operators for what are essentially flag fields. This approach lets you define in advance several constants that you can simply OR into the word, and allows you to isolate parts of interest with an AND. I'd make the whole Offset:Reserved:Flags:Window section a single word, That should also eliminate any need for worrying about memory alignment in your struct.
Some people think of it as a six-pack; I consider it more of a support group.
|
|
|
|
|
Could I not do something like this:
typedef struct len_flags
{ USHORT unused : 6,
len: 4,
flags : 6;
} len_flags;
typedef struct tcp_header {
USHORT sport;
USHORT dport;
UINT32 seq;
UINT32 ack;
#define TH_FIN 0x01
#define TH_SYN 0x02
#define TH_RST 0x04
#define TH_PUSH 0x08
#define TH_ACK 0x10
#define TH_URG 0x20
len_flags lenflags;
USHORT win;
USHORT crc;
USHORT urp;
} tcp_header;
Then test the flags like this:
if (tcpHeader->lenflags.flags & TH_URG)
tempTCP.flags = "URG ";
if (tcpHeader->lenflags.flags & TH_ACK)
tempTCP.flags += "ACK ";
if (tcpHeader->lenflags.flags & TH_PUSH)
tempTCP.flags += "PSH ";
if (tcpHeader->lenflags.flags & TH_RST)
tempTCP.flags += "RST ";
if (tcpHeader->lenflags.flags & TH_SYN)
tempTCP.flags += "SYN ";
if (tcpHeader->lenflags.flags & TH_FIN)
tempTCP.flags += "FIN ";
But it dosent seem to work , something to do with #pragma pack?
Regards
Packetlos
|
|
|
|
|
Hi
I know this is a C++ forum but i think this is a very common question.
I am creating a client server application in VB.net. client is calling a method in the server using a proxy class. I am throwing an exception on the server side. Now i want the client to capture that particular exception. How can i do that. I could able to achive this when i run both client and server on the same machine but when i run the client on the different machine I am getting an exception server generated and exception check the server's config. file. How can i catch the particular exception generated by server.
thank you
|
|
|
|
|
how can i make a SDI application into full screen, in a way that application occupies entire screen(no taskbar )and no Minimizing/moving for the window..
The returned pointer may be temporary and should not be stored for later use.
|
|
|
|
|
Consider making it a dialog based app and removing the dialog's caption bar at design time. Then, in the dialog's OnInitDialog() handler call SetWindowPos() to maximize the window and keep it on top of all other windows.
PS: This won't cover the taskbar.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hey Ravi, Thats not a dialog based app..
that s a SDI app.
The returned pointer may be temporary and should not be stored for later use.
|
|
|
|
|
you can do the similar thing for the sdi application too.. in the onCreate event remove the caption style before the frame is created.
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
ok lemme try
The returned pointer may be temporary and should not be stored for later use.
|
|
|
|