|
I have some data acqusition software in pc, This pc is acquireing data, I want send this data to another pc through USB. How I can Access USB driver?, What are the driver files? If some sample programme is there kindly send to me.
Regards,
subbu
|
|
|
|
|
USB wasn't designed for that, so you cannot do it without extra hardware. Best is to put an ethernet or 802.11 adaptor on USB, and use standard ip/sockets to comunicate.
Some companies make (or used to make) adaptors that would also do this. However I'm not sure extactly how they work, so I can't be sure they will provide you an interface to send data.
There is socket examples all over the internet, search them out.
|
|
|
|
|
hi,
I want to create only one instance of my application ,,
that only one instance run at a time on one PC.
any help or code plz
thanx
|
|
|
|
|
put a named mutex into the startup function...
|
|
|
|
|
How can i use Mutex ..
Plz send code example i not know abut it
thanx
|
|
|
|
|
Try CSingleInstance[^] by PJ Naughter.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fuity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
|
Another example can be found here.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi All,
I have small doubt about Critical Section. Is there is any specific reason for using Critical Section object as a class member. why don't declare global Critical Section object and it will be used for lock & unlock in multithreading application.
for example
Class Test
{
public:
int x,y,z;
int function();
private:
CRITICAL_SECTION cs;
};
for locking & unlocking we are using cs in Multi Thread program.
instead of that
CRITICAL_SECTION cs; //global for all object....
Class Test
{
public:
int x,y,z;
int function();
};
now cs activing as global object which will be used for locking & unlocking.
whether about code is correct or not ?. is it works in multithreading application.
Please clarify the above doubt.
Thanks,
Regards,
Prem.
|
|
|
|
|
If you have multiple instances of class Test which I assume you do otherwise you wouldn't need a critical secion then the critical section must be either a static inside the class or a global. ie. All instances of the class must see the same instance of the critical section. IMO it is better in the class as I don't like things polluting the global space.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
It depends what you are trying to control access to.
With the critical section as a private member, as in the first example, it can be used to synchronize access to the members/methods of that instance without affecting other instances of the same class.
|
|
|
|
|
Mike Beckerleg wrote:
With the critical section as a private member, as in the first example, it can be used to synchronize access to the members/methods of that instance without affecting other instances of the same class.
Yes, I didn't think of that.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
It's a design decison, it depends how finely you want to control your locking. In principle each resource should have a CS (or other synchronisation). So in your class Test it's appropriate to have a CS in each instance of the class since the resources being protected (function and x, y, z) are unique to each instance of the class.
But be careful about copying classes that contain CRITICAL_SECTIONS, I think each instance needs a new one, not a copy of an old one, so you need to write copy constructors etc. I suggest a helper class.
Paul
|
|
|
|
|
Thanks for your valuable suggestions. If any material available for how to use synchronisation object and various design methods etc....Please help me.
Once again Thanks for your comments...
Regards,
Prem
|
|
|
|
|
Has anyone got the IElementBehaviorLayout inteface to be executed properly. I have created a simple behavior which needs to draw itself and therefore needs to specify its size to the IE layout engine. The GetLayoutInfo() method is called but no other unless I set the width/height in style. I can set them to 0, any value will do. It also works by setting position to absolute but I don't want this. Setting the style values programatically in the behavior init method also works. None of the MS samples show usage of the IElementBehaviorLayout interface.
If anyone has any clues I would be most grateful
Andy H
|
|
|
|
|
I have a simple question about static member variables in C++: when are the static member variables created/initialized? When the first instance of the class is instantiated, or when the program starts? If class A is defined in another file, can I immediately access a static member variable called m_SomeInt using A::m_someInt immediately at the beginning of my program, when no instance of class A is created yet? (assuming m_someInt is a public member)
Thanks!
|
|
|
|
|
For the static member to exist, it is not necessary that any objects of the class type exist.
See Static Data Members[^]
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fuity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
I associate rtf files with my app.I want to add the same property sheet that Microsoft has implemented for Word when you right click on a doc file and appears a property sheet called Summary.How can I do this?Thanks a lot.
|
|
|
|
|
Call ShellExecute() with the "properties" verb.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I have found on codeguru in Shell section something but it is an ATL project.How can i convert it to a MDI project?
Thanks.
|
|
|
|
|
Hi all..
How can I change bg color in SDI?
I know that I can do it by handling WM_ERASEBKGND message
My code look like this
BOOL CSomthingView::OnEraseBkgnd(CDC* pDC)
{
CBrush br(RGB(127,127,127));
CRect rc;
GetClientRect(&rc);
pDC->FillSolidRect(&rc,&br);
...
...
return TRUE;
}
But when this code is called.. Windows fliker..
How can I change that code..?
What I thought is that I can do it by changing WNDCLASS's hbrBackground
But I have no idea how to do it?
Is there better way to do it?
|
|
|
|
|
Changing the WNDClass would not help you, you'll get the same flicker. Basically, you have two ways to go:
1. Just return TRUE from OnEraseBackground, and draw all of the view in OnDraw instead. Preferably to a memory CDC. See http://www.codeproject.com/gdi/#Device+Contexts[^] for such a beast.
2. If the view contains controls, you might want to add the style WS_CLIPCHILDREN to the view.
|
|
|
|
|
How can i change the text color of a static control on a dialog box, From the dialog class.
i.e, i want to make the text color of the static control to blue. I have a variable for the static control
CStatic m_cStaticName; attached to the control.
thanks in advance..
|
|
|
|
|
You have more articles than you can comfortably shake a medium-size stick at here: http://www.codeproject.com/staticctrl/[^]. Basically, you want to derive your own class from CStatic , and handle the reflected WM_CTLCOLOR message.
|
|
|
|
|
I exactly dont want to subclass. I want it to be done from Parent dialog class.
any way.?
|
|
|
|