|
|
Dominik Reichl wrote:
If you want to handle endianess you must swap the two bytes on one (and only one!) system.
I would typically use htons on the sender and ntohs on the receiver (Host-to-Network Short, Network-to-Host Short). Those functions will convert between the network representation (always big-endian) and whatever the current (host) system is (little-endian for all Windows systems).
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
I added bitmaps in array and display in screen. By clicking mouse event, i increment the image and load next bitmap.Now i need to know the currently selected bitmap for further validation and processing. It will be easy if it returns Resource NO or ID so that i can verify and process. Getobject and GetCurrentBitmap does not solve this issue.How to do it?
BSugu
|
|
|
|
|
you can use a hash table and bind ResourceID and HBITMAP
CMap <UINT,UINT,HBITMAP,HBITMAP> m_map;
might do the trick if you want to use stl there is map class available
|
|
|
|
|
Hi,
I am working a project for my class.And I don't know how to use non-system fonts for dialog,button,label,etc...(because I want to display an Asia language for my app.)
Anyone helps me...Thanks for reading my question.
|
|
|
|
|
you can create a CFont with the appropiate font names sizes and stuff
then use SetFont(&m_font);
i can't even remember what my point is now, but anyway, i'm correct
Barring unforeseen acts of God and Adminstrators, my server will be up tomorrow. I'm more worried about the Adminstrators.
|
|
|
|
|
|
i posted this already once, but it seems like nobody noticed it...
this is really important and urgent...
i need help with my timeouts. i can get my program to read/write single bytes, but the problem is a function related with the hardware i'm using.
you send the command and the hardware will enter a loop sending you each 3ms 7 bytes.
i can't set the timeouts properly in order to receive all those bytes (the most important thing is that i don't loose any bytes!)...
can anybody please help me??
thank you in advance...
Я люблю русский языкь!
|
|
|
|
|
...it is not clear whether you use API or something else on PC side???
pozdrav
|
|
|
|
|
i use CreateFile(), ReadFile(), WriteFile() && CloseHandle().
i set the timeout values with setcommtimeouts
Я люблю русский языкь!
|
|
|
|
|
...if I understand properly, you want the synchronization based on your external hardware event, which signs the beegining of transfer and you want starting timeout than. If this scenario is corect you should try with DCB and COMSTAT structure and settings of fCtsHold, fDsrHold etc. to inform your PC about e3xternal events. SetCommState() and GetCommState() are useful functions, too. But this approach needs mutithreading and synchronization, but it is worth of effort........
pozdrav
|
|
|
|
|
no, no...
these are the 7 bytes i get ach 3ms:
byte1 byte2 byte3 ...
ID data1 data2 ...
each frame begins with 0x37 - thats the id that tells me where i may begin with the synchronization.
but the problem lies somewhere else:
i can't set the reading timeouts (SetCommTimeout()) properly to keep up with those 7 bytes each 3ms...
i'm able to keep up for about 10 seconds; each 10 seconds i loose some frames.
one of the reason is this very slow computer i'm using... (my program's got to work event on 133MHz machines!)
Я люблю русский языкь!
|
|
|
|
|
i couldn't understand your question please give some clarification.
if your hardware support XON OXFF you can try this. otherwise.
let your Read thread get Higher Priority than other thread.
i hope it will help u.
|
|
|
|
|
i couldn't understand your question please give some clarification.
if your hardware support XON OXFF you can try this. otherwise.
let your Read thread get Higher Priority than other thread.
i hope it will help u.
|
|
|
|
|
фил wrote:
each 10 seconds i loose some frames. one of the reason is this very slow computer i'm using...
You may need to resort to a device-driver if you really need to work on very slow computers.
If you are working on a real OS , that is something NT-based, you could try a service with a higher priority, if needed.
I think the problem is not so much the speed of your PC. That sould be sufficient for a task like this. I suspect the Windows introduced lack of reproducability of the reaction time.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
it thought of writing myself a device driver, too; but then i thought of some cheap programs that used to work for win95 and they managed to do well without any ddk.
and besides that, you got software and hardware fifos you can setup to whatever size you need so even when you're synchronizing with the frames on a very slow machine it should be enough picking up some KBs each 10, 20, ...60 secs to keep up...
i think one must be able to fix this by altering the timeouts...
maybe you got some other ideas...
thanks
Я люблю русский языкь!
|
|
|
|
|
|
HI,
I have an VC++ application working fine on win 2000, but on XP I get a "Dialog Failed" error while launching an ODBC Data Source administrator dialog (Selecting an user DSN)
Can anyone let me know what could be wrong?
Thanks
|
|
|
|
|
try installing the latest mdac, might help
i can't even remember what my point is now, but anyway, i'm correct
Barring unforeseen acts of God and Adminstrators, my server will be up tomorrow. I'm more worried about the Adminstrators.
|
|
|
|
|
Hi,
I have extremly large Excel file, where each of columns present one proces measurement. I can not find simple and useful way to read every column and transform that into *.dat file to prepare for MATLAB.
Help is realy nedded
D.J.
|
|
|
|
|
Or at least... unix command-line tools, such as sed, awk, grep, cut, etc.
I would simply export the file as CSV, and then do some simple text processing on it. I recommed you install mingw or cygwin for a quick way to get those tools.
You can also get it done with macros in a decent text editor, I suppose.
-- Nitzan
|
|
|
|
|
...unfortunately I am in Windows environment completelty and I should be in that one all the time, security rezons...thanks anyway
pozdrav
|
|
|
|
|
Maybe I wasn't clear enough: you can install a small subset of the command-line utilities on Windows. They're great for everyday tasks. I recommed you go look at mingw: minimal GNU for Windows.
Still, if you don't want to for some reason, my suggestion still holds: export as CSV, and use a macro of some sort in a text editor to format for MATLAB.
-- Nitzan
|
|
|
|
|
...could you tell me where I can find it instalation packet?
pozdrav
|
|
|
|
|
You need MinGW Runtime, MinGW Utilities, MinGW, and get binutils too 'cause its useful.
There is another post in this thread which is also correct: I suppose you can simply google for "windows awk" or "windows sed" to get just these.
-- Nitzan
|
|
|
|