|
What is the definition of D2R() ?
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"
|
|
|
|
|
Heh, it better be defined as
((x)*PI)/180
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I agree, but that's the only thing I can think of that would cause his problem with atan()...
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"
|
|
|
|
|
While it is assumed that D2R is "degree to radian," it is also likely that D2R includes the use of PI, which can be defined as 4.0 * atan (1.0). In that case, you could get an error involving atan. I assume you have #include math.h?
You could also just assign PI a value of 3.14159 etc, depending upon the accuracy you need, if it is indeed used in D2R.
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
Hello,
I am having problems creating queues and I would like code, non-MFC, but pure C++ that allows a user to insert data into a queue and then display it all when they are done. Just a simple command line program. I know to use classes.
Thank you for reading.
-Ryan M.
|
|
|
|
|
Why don't you have a look at the STL queue class? Sure beats writing your own
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~
I'm a printer driver developer in Yang-jae System which develop printers, Korea.
I have a question on TCP/IP Printer Port.
When using a print server, creating a TCP/IP port must be done.
On Windows 2000, XP and 2003, Standard TCP/IP Port is provided by OS,
but On Windows 98 and Me, Standard TCP/IP Port is not provided by OS.
So, a Vendor provides a program creating a TCP/IP Port.
I want to implement this program.
I don't know the way to create and add an TCP/IP Port at all.
Can I get your advice or outline on this?
Please help me...
Have a nice day!
|
|
|
|
|
TCP / IP provide port in the window 98 , me that it can,t operation.
because of no more provided to micro soft company, TCP / IP attend to exchange window 2000,xp i think... so your printer port look for compactly all of them. firt of all reference learn TCP/IP protocals.
i recommand in msn under the website. I look up the benefical reference.
i can try to learn as a vendor.
i like that you are little better than advice.
have a great day ?
see you.
|
|
|
|
|
pls help me in this because i do not know the right commands to be used in programing the transfering of wav file from one pc to another using parallel port. Thank a lot!you are greatly appreciated!
|
|
|
|
|
Hi, is there an easy way to Generate a GUID from code with Visual C++. The only references i can find involve COM. Is there any support from MFC?
thanks in advance
Carl
|
|
|
|
|
Hello Carl,
Try : UuidCreate() or UuidCreateSequential().
Regards,
Bio.
|
|
|
|
|
thanks Bio.
Carl
|
|
|
|
|
Hello all,
I'm trying to figure out what I'm not seeing here. Check out the code fragement...
void CHELPTSTDlg::OnButton1()
{
AfxMessageBox("Ooh baby", MB_HELP, 1234);
}
BOOL CHELPTSTDlg::OnHelpInfo(HELPINFO* pHelpInfo)
{
CString c;
c.Format("In Help info, ID = %d", pHelpInfo->dwContextId);
AfxMessageBox(c);
return CDialog::OnHelpInfo(pHelpInfo);
}
The pHelpInfo->dwContextId variable is ALWAYS 0 in the OnHelpInfo handler. Anyone have any ideas what I'm missing? Simply trying to start WinHelp with the context ID I pass in the message box.
Thanks!
Paul...
|
|
|
|
|
It's been a while since I've done this, so I was wondering how everyone is building help files these days? Last time I did it I was making a .hlp file, but now I think it is .chm ... right? So - anyone know how to create these?
Thanks!
Marcus Spitzmiller
"Why must life be so hard? Why must I fail at every attempt at masonry?" - Homer
|
|
|
|
|
My assignment is to write an interface sending 16-byte command messages and receiving 54-byte response messages at 230.4 Kbaud down two RS422 buses. At one time I considered bit-banging the interface on an 8-bit 8051-family microprocessor. Now I'm trying to do it in Visual C++ .NET. It will run on a laptop running Windows XP, using the Quatech DPS-200/300 Dual Channel RS-422/485 PCMCIA Asynchronous Adaptor, connected to a external device manufactured by another company.
I've been reading MSDN documentation for days. Searching for RS-422 leads me to documentation about CIM, WMI, MOF, file and directory I/O, and other things that have no direct bearing on my assignment. Trying to mine small nuggets of useful information out of these reams of documentation is worse than trying to learn multithreading from just the MSDN documentation (which I just did).
I need a simple (perhaps over-simplified, or even simplistic) instruction on how to create/establish/connect to the communication resource, transmit messages at specific times, receive messages, and terminate everything before shut down. I don't need to know how to use Windows Management Instrumentation to establish an enterprise environment--this is low-level I/O to an ad-hoc device. My software will me installed on two, maybe three systems throughout it's entire lifecycle.
At one time I thought I would need Windows CE or XP Embedded (along with something like TenAsys's or VentureCom's RTX real-time extensions), because my system has about 900 microseconds from receipt of a response message to begin transmitting the next command message. I may need these things anyway, since the worst-case scenario has that time down to 36.1 microseconds.
Norman Hines
Jacobs Sverdrup Naval Systems Group
|
|
|
|
|
Norman Hines wrote:
I need a simple (perhaps over-simplified, or even simplistic) instruction on how to create/establish/connect to the communication resource, transmit messages at specific times, receive messages, and terminate everything before shut down.
Serial ports are opened using CreateFile(), specifying "COMx" as the filename, where x is the number of the COM port. Reading, writing is done using ReadFile(), WriteFile() and CloseHandle() as for normal files.
As for sending messages at specific times, I don't know what the best way would be, especially with sub-millisecond performance required. Windows is notorious for having dodgy, inaccurate timing at best. A sleep for a single millisecond can last upwards of 20ms depending on system load. If you need a round-trip response time of 36.1us, the only way forward using Windows (that I can see) would be to use a realtime enviroment such as VentureCom's RTX extensions that you mentioned.
However, you could have a look at the performance counters or the multimedia timers. They may be able to cope with the timing precision required under low system load, but if other applications preempt your application, there's really nothing you can do about it. Even increasing your process' scheduler priority may not be enough.
Hope this helps,
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"
|
|
|
|
|
The very first thing stops me dead. CreateFile's first parameter is a pointer to the name of the port to be opened. What name do I use for a PCMCIA card slot? Is it "PCMCIA1"? Or is it some kind of COM port, and I just need to look up the number?
BTW, I'm getting a jump on the software development on a computer without the PCMCIA hardware, while I wait for the ordered equipment to arrive.
Norman Hines
Jacobs Sverdrup Naval Systems Group
|
|
|
|
|
RS422 is simply an RS232 port with differential electrical signalling. It's still a serial port like any other. You just need to find the correct COM port number and it should all work OK.
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"
|
|
|
|
|
For my RS422, I'll be using a 2-port RS-422/485 serial PCMCIA card, inserted into the PCMCIA port on the side of a laptop. Are you telling me that this PCMCIA card slot is accessed as a COM port? Were would I find out which COM port (or ports!) they are? Is this defined in the hardware? Do I call up Dell and ask them into which COM port they wired the PCMCIA card slot? Do I wait until I have the laptop itself and experimentally test "COM1" through "COM9" until I find the right one?
Norman Hines
Jacobs Sverdrup Naval Systems Group
|
|
|
|
|
Norman Hines wrote:
Are you telling me that this PCMCIA card slot is accessed as a COM port?
No. The card driver will make the ports appear as though they were individual serial ports. It makes no difference if it's PCI, PCMCIA, ISA, USB etc... The difference in architecture is abstracted by the driver that comes with the card. All you need to worry about is which serial port number Windows associates with the physical ports.
Norman Hines wrote:
Were would I find out which COM port (or ports!) they are?
Unfortunately, there isn't a way that I know of. AFAIK, you'll need to rely on a configurable option that the user can set to input the correct one to use. WMI might be able to associate the COM port number with the PCMCIA card information, but I haven't used WMI before so I'm not sure.
Norman Hines wrote:
Do I wait until I have the laptop itself and experimentally test "COM1" through "COM9" until I find the right one?
Yep. Sounds stupid, doesn't it? Windows allocates port numbers first-come-first-serve. So if you add a new serial port and you have COM1 and COM2 already, the new one is COM3, no matter where it gets added.
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 guys
I have developed one appication in which I have used many array variables and also used malloc and calloc functions to reserev memory and also tried to free all the memory. But because of some bug in it. After certain long time my application stops running. And if i see in Task Manager it shows all memory used.
So I want to debug my application putting some debug statement in file or some statements through which I can get the exact memory at perticular sentence. Is there any such function which gives currently used memory or something which can help me...
Regards
Mahesh
|
|
|
|
|
Hi Mahesh..
I am not sure about the code part, but I am sure that if you can patiently go through your code, then 80% of your problem will be solved. Just remember that every time you use malloc, make sure that you are using calloc somewhere for that particular pointer.
Regards
Mahadevan
|
|
|
|
|
Hi, I am trying to understand a C/C++ concept with pointers.
I have a function that expects a LCPSTR.
If I hard code a statement such as
LCPSTR temp = "213234";
it works great.
However I have a char array I would like to
use for this value that is input from a user. How can I convert
a char array to a LCPSTR type?
Is this a valid approach?
___
CHAR bob[25];
//...put something in bob - like "123456"...
LCPSTR temp2 = (LCPSTR) &bob[0];
Then pass temp2 to the function that requests a LCPSTR?
Will that only grab the first item ("1") in the array or all of it ("123456")???
____
I'm not sure if I have made sense.
In general - what do you do when you have a char array or char *
and a function is asking for a const char * ? How do you make that conversion?
|
|
|
|
|
rtb333 wrote:
In general - what do you do when you have a char array or char *
and a function is asking for a const char * ? How do you make that conversion?
In C/C++ arrays are very similar to pointers. You don't actually have to convert anything in this case. The following code will work without problems:
CHAR bob[25];
LPCSTR temp2 = bob; Also, you can pass a char* to a function requiring a const char* without converting anything.
Hope this helps,
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,
My SDI mfc program opens up an external ansi c++ program using shellexecuteex. The user opens a dialog in the mfc program, sets parameters for the external program, and clicks go. This works fine, and the external program opens up in a command prompt window, runs, then closes its window.
I would like to display the contents of the command prompt window inside the dialog with which the user set parameters for the external program. Ideally the output of the external program would appear in an edit box or static text on the dialog itself. This is just to improve the aesthetics of the mfc program and give it a more integrated look and feel.
Does anybody know if this is possible?
Thanks!
Mick
|
|
|
|