|
I think the code for inline functions must appear in your header file; you can't have just the declaration. It's similar to a macro.
|
|
|
|
|
I know that for templates, but with plain inline functions too? =/ Never happened to me before... Is this a VS thing?
regards
Fratelli
|
|
|
|
|
I am trying to write out an array and all I am getting is junk in the file.
Here's the code:
short frameData[3648];
short *p;
file.Open( "C:\\test.txt", CFile::modeCreate|CFile:: modeReadWrite);
p = (short *)Frameptr;
for ( int i=0; i<= 3647; i++)
{
frameData[i] = *p;
p++;
}
file.Write(frameData,sizeof(short)*3647);
file.Close();
modified on Monday, July 14, 2008 2:34 PM
|
|
|
|
|
aei_totten wrote: ...all I am getting is junk in the file.
How are you verifying this? What should be in the file?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I open the file and there are a bunch of weird chars, boxes, greek letters, etc. and the data is an array of numbers in the 646-780 range. I step through with the debugger and the array is populated fine.
|
|
|
|
|
Well, you asked to write the array as a binary format into the file, so each short from your array will be writte as two bytes in the file (thus resulting in garbage characters). You first have to convert each short into a string and write that string into the file.
|
|
|
|
|
|
aei_totten wrote: Thanks that was it, duh.
Yeah, imagine that! The file had in it what you told the computer to put in it! Wow, what will they think of next?
led mike
|
|
|
|
|
led mike wrote: Wow, what will they think of next?
This![^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Sure but I like to pronounce that Shamoo
Have you tried one? Does it really work? Or is it a misinfomercial?
led mike
|
|
|
|
|
led mike wrote: Does it really work?
Works great on the commercial! I haven't tried one though.
German technology - it HAS to be good!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: German technology - it HAS to be good!
Yep[^]
Two and a half years ago, the bursting of the dot-com bubble erased most of the market value of Germany's technology sector. Now, the market itself is being scrapped. Deutsche Börse, which runs the Frankfurt stock exchange, announced today that it would close the Neuer Markt -- the technology-related market that is Germany's answer to the Nasdaq -- by the end of 2003.
led mike
|
|
|
|
|
and for some reason it isn't posting a less than or equal to in my loop, I even tried to go back and edit it with no luck.
|
|
|
|
|
Okay new problem.
I decided to write the file each element at a time.
Here is the new bit of code...
for ( int i=0; i<= 3647; i++)
{
frameData[i] = *p;
temp.Format("%d ",frameData[i]);
file.Write(temp,sizeof(temp));
p++;
}
but instead of getting each number followed by a blank which is what I had intended. I get some of the numbers on top of each other (like four in a row) and some of them correct.
|
|
|
|
|
oh yeah temp is a CString
|
|
|
|
|
for ( int i=0; i <= 3647; i++ )
{
frameData[i] = *p;
temp.Format("%hd ",frameData[i]);
file.Write(temp, temp.GetLength() * sizeof(TCHAR));
p++;
}
If you're writing all text, maybe CStdioFile is a better class to use...
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks so much. I can't believe how much c++/mfc I had forgotten since switching to C sharp and Java. But somethings you just can't beat in c++.
|
|
|
|
|
aei_totten wrote: But somethings you just can't beat in c++.
You can beat a fish.
led mike
|
|
|
|
|
Hello everyone!
I have built a digital table with a pencil (like a wacom) and I'm doing my own drivers.
He managed to move the mouse through the following simple code [Visual C + + in XP]:
INPUT aInput;
aInput.type = INPUT_MOUSE;
aInput.mi.dwFlags = MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
aInput.mi.dwExtraInfo = 0;
aInput.mi.mouseData = 0;
aInput.mi.time = 0;
aInput.mi.dx = (data.X * 65535.0f);
aInput.mi.dy = (data.Y * 65535.0f);
int aResult = SendInput(1, &aInput, sizeof(INPUT) );
But, I do not see how you can send to the system/software (Photoshop, paint ,...) data with the pressure of the pen to draw. I suppose that will be a standar, but nothing found information about it.
Someone known as is done? That object is used?
Thanks!!
|
|
|
|
|
motivinteractive wrote: But, I do not see how you can send to the system/software (Photoshop, paint ,...) data with the pressure of the pen to draw. I suppose that will be a standar,
I think you are looking for the Wintab specification for drivers.
http://www.smartcomputing.com/editorial/article.asp?article=articles/archive/r0403/06r03/06r03.asp&guid=[^]
Software. Without appropriate software support, no peripheral can communicate with the computer. In the case of digital tablets, this means each program must support the tablet with an API (Application Program Interface), and each tablet must include a software driver.
The application developer is responsible for implementing the AP correctly. Wintab is the most popular tablet API in use. Developers can add the Wintab API to their application and support almost any tablet on the market today. API's are often specific to a category, such as tablets, but are not device specific. (For more information, see "Programming Foundations" in this issue.)
Software drivers, on the other hand, are device specific. Each device has different features and speaks a slightly different language. Each driver is written for a specific tablet and translates the tablet's language into something Wintab can understand. This lets developers implement support for a wide range of tablets without having to write support for several different devices.
led mike
|
|
|
|
|
Hello all,
I want to change the bitmap for the mouseover, mouseup and mousedown events in the CBitmapbutton. Please guide me.
Kind regards,
Banu
|
|
|
|
|
Create event handlers and write your code in them.
led mike
|
|
|
|
|
Dear Mike,
I add the event handler but when I move mouse to the dialog the event is triggered but I need to trigger the mouse move event whenever I place the mouse over the bitmapbutton. Please advice.
Thanks and Regards.
|
|
|
|
|
I used the BCN_HOTITEMCHANGE but I dont know how to implement. Please advice.
|
|
|
|
|
I want to implement a timer in MFC application so that I can set the time of ten seconds .
so after every ten seconds it fires and i can process my code after every ten seconds
Ashish
|
|
|
|