|
CString mystring = "0434324423";
if(mystring.Left(2) == "03")
{
<Do what you want>
}
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Nothing easier than this
Sometimes I ask myself whether people don't search the MSDN (no offense)
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi Friends,
Is there any difference between Win32 ans Win32s ? I hope the question is peroper.
|
|
|
|
|
|
Great information. for me.thanx.
VikramS
|
|
|
|
|
win32s("win32 subset") is an extension for windows 3.1 to support win32!
that's it!
Don't try it, just do it!
|
|
|
|
|
I noticed that the C libraries test for _UNICODE, while Win32 tests for UNICODE.
Would it be OK to
#ifdef UNICODE
#define _UNICODE
#undef _MBCS
#endif
as first statement in stdafx.h?
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Yeah, no problem, or you could just specify both on the command line
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"
|
|
|
|
|
Hello world!
I want that my app capture all mouse messages... not only the view!
With Get/Set/ReleaseCapture that's ok for the view! But when the mouse cursor go out the frame window of my application mouse messages are not send to my app... How to do that?
Thanks in advance...
Hello World!!!
from Raphaël
|
|
|
|
|
SetWindowsHookEx(WH_MOUSE, YourHookProcMouse, instance, GetCurrentThreadID())
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
hi
the following code gives me the error even i included winsock32.lib or ws2_32.lib.
The platform SDK clearly specifies IRDA support.
the WSAGetLastError() returns me 10047
stating "Address family not supported by protocol family. "
this is from MSDN :
SOCKET ServSock;
if ((ServSock = socket(AF_IRDA, SOCK_STREAM, 0)) == INVALID_SOCKET)
{
printf("\n error in sockets : %d", WSAGetLastError());
return;
}
apart form this if any one give me a sample code on IRDA it will be helpful.
Many Thanks!!!
|
|
|
|
|
see KB266241 BUG: Error 14007 When You Create a Socket Using AF_IRDA.
Maybe you have similar problem
|
|
|
|
|
I maked a test application for my HF-Transceiver. To communicate between PC and the Evolationboard of the HF-Transceiver I use the COM Port. I can't use the normal functions for serial communication, because my own telegramm to the transceiver don't have any Start or Stopbits. So I use the functions _inp and _outp to communicate directly with the register from the COM Port at adress 3F8 (COM1). To send the Data I used for synchronization an external clock signal, which I conacted to the CTS Pin. Now, I tested my programm and not all telegramm were correctly send. I modificated my programm to send only 01 as data for testing. With an oscilloscop I meased the CLOCK and DATA pin. I saw the error, the 01 intervall wasn't correctyl send. The error look like this.
CLOCK 01010101010101010101010101
0DATA 00110011001100001100110011
ERROR ( 4 * 0 is not correct)
It's funny, the CLOCK have 4600 baud normally. If i increase the baud rate to 19200 baud, no more error will be found. I don't know, if the problem is windows, because my thread can be stopped by windows, for short time. Or the problem come's from my code. This is my code for my send thread. I hope anyone have an IDEA or anyone can say an Internet adress to this theme THANKS!!!
bool m_bSendBit=false;<br />
bool lastBitOne;<br />
bool lastDataOne=false;<br />
<br />
if(_inp(m_ComBasisAdresse+6)&16)<br />
lastBitOne=true;<br />
else <br />
lastBitOne=false;<br />
<br />
while(!m_bSendBit)<br />
{<br />
if((_inp(m_ComBasisAdresse+6)&16)&&!lastBitOne)<br />
{
m_bSendBit=true;<br />
lastBitOne=true;<br />
}<br />
else if(((_inp(m_ComBasisAdresse+6)|65519)==65519)&&lastBitOne)<br />
{ CLOCK = 0<br />
m_bSendBit=false;<br />
lastBitOne=false;<br />
}<br />
} <br />
while(m_bRunFlag)<br />
{ <br />
m_bSendBit=false;<br />
for(int i=0;i<m_sDatatelegramm.GetLength();i++)<br />
{<br />
while(!m_bSendBit)<br />
{<br />
if((_inp(m_ComBasisAdresse+6)&16)&&!lastBitOne)<br />
{
m_bSendBit=true;<br />
lastBitOne=true;<br />
}<br />
else if(((_inp(m_ComBasisAdresse+6)|65519)==65519)&&lastBitOne)<br />
{
m_bSendBit=false;<br />
lastBitOne=false;<br />
}<br />
}<br />
<br />
if(!lastDataOne)<br />
{
_outp(m_ComBasisAdresse+3,64);<br />
lastDataOne=true;<br />
}<br />
else<br />
{
_outp(m_ComBasisAdresse+3,0);<br />
lastDataOne=false;<br />
}<br />
m_bSendBit=false;<br />
}<br />
while(!m_bSendBit)<br />
{<br />
if((_inp(m_ComBasisAdresse+6)&16)&&!lastBitOne)<br />
{<br />
m_bSendBit=true;<br />
lastBitOne=true;<br />
}<br />
else if(((_inp(m_ComBasisAdresse+6)|65519)==65519)&&lastBitOne)<br />
{<br />
m_bSendBit=false;<br />
lastBitOne=false;<br />
}<br />
}<br />
_outp(m_ComBasisAdresse+3,0);<br />
Sleep(2);<br />
}
|
|
|
|
|
First of all you should post your code by using < pre > and < /pre > tags.
My first comment would be about the start and stop bits. I think that no matter what, the UART inside the computer will send start and stop bits. I could be wrong because the last time I dealt with UARTs was 3 years ago, so check the books.
Sending clock signals is achieved by XOR-ing the last bit sent with 1 and then sending the new bit. It is faster and requires less hardware (in case you decide to put in hardware).
// Pseudo code
If clock.transition
BitToSend = LastBitSent XOR 1;
LastBitSent = BitToSend;
I think your problem is related to the start and stop bits, that you are ignoring. Check the frequency of the error (how many bits are correct before it happens?). What is CTS by the way because I don't seem to remember (Clear To Send? - if so why is your clock connected there?).
When you say an external clock, do you mean you have a crystal providing the clock signal, or are you sending it through the serial port? (your program looks like it is sending the clock signal through the serial port).
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Sorry, I posted for the first time so much code. In my message i marked all code and click "code". Now the colour is brown. Is this not OK?
The Start & Stopbit will be send by the normal functions of "Visual C++". Only with the functions _inp and _outp I can only send my bits.The error didn't appear at all telegramm. Only in some telegramm.
Your are right, the CTS pin is normaly (CLEAR TO SEND). But I connected the extern created clock (from the transceiver or Waveform Generator) to this pin, becauce I can read this pin in the register with _inp.
|
|
|
|
|
Nuehli wrote:
Sorry, I posted for the first time so much code.
No, no, it's okay, but it is always a good idea to use &lg pre > tags. Some comments would be great too because I don't understand statements such as this one:
else if(((_inp(m_ComBasisAdresse+6)|65519)==65519)&&lastBitOne) (there are more statements that I don't understand).
Still it is not very clear why the clock is connected with clear to send (doesn't the uart reset that signal on its own?). Every time the clock goes high, you send data out, right?
Did you check the error frequency?
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Anyone has algorithm for drawing a line parallel to another line?
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Paul Selormey wrote:
Anyone has algorithm for drawing a line parallel to another line?
Line : (x|y) to (p|q)<br />
Parallel: (x+i|y+j) to (p+i|q+j)
Is it that what you wanted?
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Another solution if you have only the line equation: y = a*x+b.
Just change the offset value (b), the slope will be the same: y' = a*x' + c.
Hope this helps
|
|
|
|
|
How is your line specified at the moment? How you draw the next line will depend on that.
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"
|
|
|
|
|
If you want to draw your line parallel to an existing line, you should store the points of that other line. You can use the suggestions provided by the others for drawing, they work perfect!
good luck!
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Thank you all for your support. I really need a routine which will work with polylines, handling the joints as well.
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
I don't think that such a routine exists, but feel free to write it yourself
If it takes too long to get what you want, do it yourself
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Right, I am working on it - just have to handle the joints well to complete it.
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Hello,
1) how can I get the local domain name (normally something like WORKGROUP)? The method should work on both NT-systems and 9x.
2) how can I enumerate the network adapters? I've found only a method that uses Iphlpapi which I don't want to use.
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|