|
Gosh. It's urgent. That's highly original of you. We'd never have realised it was any more urgent than the thousands of other "urgent" messages without you telling us.
There's this wonderful tool called Google that may have slipped your attention. It might just help solver your problem. Clickety[^]
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
|
Language Processors[^] is an excellent book on the subject. You might want to read it.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
All messages in this thread have been voted down!
Why?
All the best,
Martin
|
|
|
|
|
Not anymore they haven't
Both answers were totally valid and I voted them both 5.
|
|
|
|
|
|
Hello,
J4amieC wrote: Both answers were totally valid
true
J4amieC wrote: and I voted them both 5.
Me too!
I was just wondering why somebody voted '1'!
All the best,
Martin
|
|
|
|
|
Martin# wrote: I was just wondering why somebody voted '1'!
Because most people are dicks!
|
|
|
|
|
Because we didn't do his coursework for him.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: Because we didn't do his coursework for him.
Maybe, but even the question got downvoted at the same time.
All the best,
Martin
|
|
|
|
|
The message was downvoted before Pete or I got to it.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
Ahhhhhhhhh, ok!
Now it's clear, and Pete hits the Bullseye!
All the best,
Martin
|
|
|
|
|
Hello everyone. I am having quite a problem with this. I am developing a project board that uses a Microchip PIC, and up until now I was using the general Microchip provided dll along with some snippets of code I bunched together. All I needed was a way to send 64bytes of data out and receive 64 bytes of raw data. That is it. That is still all I need.
If you want to jump ahead to the problem look for "===========PROBLEM===========" below... Otherwise this is the full story.
The problem is that Vista does not play nice with this dll. So I am forced to use WinUSB which is fairly new and very little documentation I can find. And to compound the situation, the little code I find, is all written for C++ or contained in header files.
I need to get this working in C#, and I need to do it soon. If anyone can help I would greatly appreciate it.
From my understanding I need to first crete the inf file, with the correct co-installers as well as a unique GUID. This I have already done and it is successfully recognized by Vista and XP.
Then in my program I need to search the registry for a particular GUID (the general USB hub for some reason), and then iterate through each one found until I find one that contains my vid/pid in its description using SetupDiGetClassDevs and SetupDiEnumDeviceInterfaces from the setupapi.dll. I believe I have this working as I can iterate through and find my device.
Then I need to Create a file of some sort to interface with. From my searching I found this is what I should use: Intptr TheWindowHandle = CreateFile(strPath, GENERIC_READ | GENERIC_WRITE, 0, IntPtr.Zero, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, IntPtr.Zero);
Then I must initialize this file by passing in the IntPtr I get with that, to WinUsb_Initialize which spits out some other IntPtr. I take that pointer and call WinUSB_WritePipe and WinUSBRead_Pipe.
I have no way of really knowing if I have this correct unless someone is to chime in and support this. My problem though is this:
===========PROBLEM===========
I do not know how to declare the [DllImport] of winusb.dll for WinUsb_WritePipe and WinUSB_ReadPipe nor what values they take or return.
I would gladly appreciate any and all help on this and specifically C# examples. If you are willing to write the small snippet of code needed, I can compensate you for it. If you need any more information about my source code or the winusb dll or the application, just let me know.
I thank everyone in advance for the help.
|
|
|
|
|
[DllImport("winusb.dll", SetLastError = true)]
internal static extern Boolean WinUsb_WritePipe(Int32 InterfaceHandle, Byte PipeID, ref Byte Buffer, UInt32 BufferLength, ref UInt32 LengthTransferred, IntPtr Overlapped);
[DllImport("winusb.dll", SetLastError = true)]
internal static extern Boolean WinUsb_ReadPipe(Int32 InterfaceHandle, Byte PipeID, ref Byte Buffer, UInt32 BufferLength, ref UInt32 LengthTransferred, IntPtr Overlapped);
|
|
|
|
|
Hello,
VS 2005
What is the best method to embedd a picture into a windows application?
I am using the windows application as a custom action in a setup project, just looking for the best method.
Thanks,
Steve
|
|
|
|
|
If you want to embed a picture into a winforms application you can use resources or insert the picture as an embedded resource. It will make your executable larger but you will be sure that you application will always find necessary picture
|
|
|
|
|
Hello,
There was a similar thread[^] two weeks ago.
Hope it helps!
All the best,
Martin
|
|
|
|
|
Hi,
is there a description (or sample code) how to start in a form frmA a second form frmB in a thread and get access in frmA to the variables in the thread of frmB ?
Hope the question is clear...
Thanks
Andreas
Ariadne
|
|
|
|
|
Hello,
Sounds like the funktionality of a Splash screen[^]!
Summary:
Ariadne wrote: how to start in a form frmA a second form frmB in a thread
Thread InstanceCaller = new Thread(new ThreadStart(MySplashThreadFunc));
InstanceCaller.Start();
private static void MySplashThreadFunc()
{
m_instance = new SplashForm(m_imageFile, m_transColor);
m_instance.TopMost = false;
m_instance.ShowDialog();
}
Ariadne wrote: get access in frmA to the variables in the thread of frmB
Use delegates!
Colin's article (passing values between forms)[^]
If you whant to modify your GUI over an other thread:
Don't forget to use InvokeRequired and Invoke!
Hope it helps!
All the best,
Martin
|
|
|
|
|
As usual excellent post..
|
|
|
|
|
Thanks a lot!
All the best,
Martin
|
|
|
|
|
Martin,
thanks! It works.
But unfortunatly it solves not my problem: If I debug the frmA, the timer in frmB stops also. Is there a way to exclude frmB from debugging?
Or have I to use a separate application frmB and use interprocess data exchange to get the data from frmB. (frmB collects temperatures, and frmA reads them from frmB)
Ariadne
|
|
|
|
|
Hello,
Ariadne wrote: If I debug the frmA, the timer in frmB stops also. Is there a way to exclude frmB from debugging?
Hmmm, interesting task!
What kind of timer are you using?
Maybe take a look at System.Threading or System.Timers. Timer!
But I have to admit that this is without knowing something about debug behaviour!
Maybe you should start a new thread with this specific question.
I'm sure the MVP cracks or for example Luc (but also others), know more about this topic.
Hope it helps!
All the best,
Martin
|
|
|
|
|
Thanks.
Martin# wrote: Maybe you should start a new thread with this specific question.
Yes I did so...
Ariadne
|
|
|
|
|
Ok,
But you should really, try the approach with an other timer, which is not running in the GUI thread (Forms.Timer does run in GUI thread)
All the best,
Martin
|
|
|
|