|
|
Hello all
I want to code an application which can read and write using usb interface. As I'm very new to programming using usb interfaces, not able to understand how to do it. I want to use VC++ environment and want to develop a application which can read and write using usb interface just like we do with a serial port.
Can anyone help me in this. Any sample code or links to articles abt the same are very much appreciated.
Thanks for your help
Hari.
|
|
|
|
|
USB devices have a virtual serial port, their device driver is supposed to emulate a "normal" serial port. Therefor look at PlatformSDK/Device IO, and functions like SetupComm, ReadFile, WriteFile, or take a look at this library:
http://www.codeproject.com/system/serial.asp[^]
Peter Molnar
|
|
|
|
|
I am writing an application to create thumbnails (files) in the fly when an image file name (jpeg, bmp, etc.) is entered. I tried aspjpeg.dll with no success. Can someone help?
Elizabeth
|
|
|
|
|
Try CxImage (search codeproject).
Mike
|
|
|
|
|
Use the new CImage class in MFC 7.
|
|
|
|
|
Whats the easiest way of doing this?
It MSDN says I handle them inside CMainFrame ?
Are messages sent to CMainFrame as a WM_NOTIFY or what?
I can't seem to get anything working
Thanks
p.s-a small example would work wonders
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
A CDialogBar has to be programmed in terms off massage handling just like a CDialog
by creating message maps:
Within you CDialogBar:
BEGIN_MESSAGE_MAP(CYourDialogBar, CDialogBar)
ON_MESSAGE(WM_INITDIALOG, OnInitDialog)
ON_BN_CLICKED(IDC_BUTTON_ONYOURDIALOGBAR, OnBnClickedOnyourdialogbar)
END_MESSAGE_MAP()
Peter Molnar
|
|
|
|
|
By drawing Bitmap, utilizing "StretchBlt" (VC++ 6), I get upside down image. Please suggest ways to get the correct Bitmap picture.
Any help would be greatly appreciated.
German
Ls2333@mail.biu.ac.il
|
|
|
|
|
dc.SetWindowOrg(m_rect.TopLeft());
|
|
|
|
|
Change the hight sign.
Read the MSDN snippet about StretchBlt:
StretchBlt creates a mirror image of a bitmap if the signs of the nWidthSrc and nWidthDest parameters or if the nHeightSrc and nHeightDest parameters differ. If nWidthSrc and nWidthDest have different signs, the function creates a mirror image of the bitmap along the x-axis. If nHeightSrc and nHeightDest have different signs, the function creates a mirror image of the bitmap along the y-axis.
|
|
|
|
|
Anyone has an idea on how to write Outlook Express extensions like OE-QuoteFix?
Regards,
BB
|
|
|
|
|
Hi,
I am unable to watch a static variable in a watch window while debugging. The compiler is Visual C++ 6.0 (without any Service Pack).
Please note that I m not taking about static member variables of a class. I am talking about static variables local to a procedure.e.g
void procedure(void)
{
static int i;
... code follows ...
... code follows ...
}
|
|
|
|
|
Do you have a breakpoint set in procedure() ? What error/message does the debugger give you when trying to view those variables?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I can't see them too - the debugger IDE behaves as if they didn't exist.
Regards,
BB
|
|
|
|
|
So if you have a non-static variable in that same function, will the debugger see it?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Yes, of course it will.
Regards,
BB
|
|
|
|
|
Definitely, in order to watch, I have to set a breakpoint. The debugger gives this error message.
CXX0017: Error: symbol "i" not found
What I understand here is that static variables are not created and destroyed when a procedure is called. They have a lifetime of program. Why debugger is showing this message is because, I have set the breakpoint in procedure(), so debugger has a context of procedure(). So, it is unable to provide a watch on "i".
I tried to watch "i" in WinMain() but again WinMain() is also a function. Now, what I left is that declare a global variable, set a breakpoint there and watch "i". Perhaps it work.
The other approach I am using is having a pointer to this static variable "i" in procedure(). In this way, I am able to watch the contents of static variable "i". e.g.
void procedure(void)
{
static int i;
int * pi = &i;
...... code follows ......
}
|
|
|
|
|
hashimsaleem wrote:
Why debugger is showing this message is because, I have set the breakpoint in procedure(), so debugger has a context of procedure(). So, it is unable to provide a watch on "i".
The debugger should show any and all variables that have "current" scope, whether they are global, static, or local. I just tried this and it does work. Something else is at play here.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
what do you mean by "current" scope? Please explain.
|
|
|
|
|
int a;
void procedure( int b )
{
static int c;
int d;
}
void foo( int e )
{
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
This is however VC6-only problem (I have SP4 on it). Under .NET everything is clearly visible.
Regards,
BB
|
|
|
|
|
Hi guys
I'd like to ask the user to save his Doc before exit in my SDI app and then do like he pressed the Save button in menu.
Where I have to do the call, and how?
Best Regards
Doc
|
|
|
|
|
With a "normal" SDI app, everything is already in place. If the document's data is serializable, put your code in the Serialize() method. Otherwise, put your code in the OnSaveDocument() method.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
You need to monitor when the user has made a change in the document which you count as significant enough to require saving. For example the user updated a text box on your form, or drew a circle, or whatever. When that happens you must call the SetModifiedFlag(TRUE) method of your document class. The framework will then automatically prompt the user to save the document if they close the window.
Of course you still need to add code in OnSaveDocument or Serialize to actually do the work of saving to a file just as the previous user indicated.
Hope it helps...
--
The Obliterator
|
|
|
|