|
i am using two Command Buttons one for sending another for receiving data can be stored in a file
plese help me
advanced thanks
prasad raju
|
|
|
|
|
USB ports don't work like a standard COM port. Depending of the device you want are connected to, you should have received a driver with this device. Then, take a look at the documention (normaly, supplied with it). Everything should be described there.
Now, if the device connected is a USB-to-RS232 device, then it creates a virtual COM port and you should open this port and work with as a standard COM port.
|
|
|
|
|
Hi,
I have created a Device Independent Driver Code. It is working perfectly. All i need is a Application Launcher program. And that is where my problem starts. I am trying to create the file using the CreateFile Command. And it is always returning false. I have attached the code snippet below. Anyone who knows how to solve the problem please help me.
HANDLE OpenDeviceDriver(LPCTSTR szDriverName)
{
HANDLE hDevice;
TCHAR szFullName[200];
wsprintf(szFullName, "\\\\.\\%s", szDriverName);
hDevice = CreateFile (szFullName,
0,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL
);
if(hDevice == INVALID_HANDLE_VALUE)
{
hDevice = 0;
printf("%x Error %ld\n",hDevice,GetLastError());
}
return hDevice;
}
With Warm Regards
Kenny
|
|
|
|
|
What's the return value from GetLastError() ?
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
The result of the GetLastError() is 2
|
|
|
|
|
That's ERROR_FILE_NOT_FOUND
Could it be an ANSI/UNICODE problem?
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Might be. Is there any other way through which i can achieve the same? Or can we modify any settings to achieve the above.
-- modified at 4:48 Tuesday 22nd August, 2006
|
|
|
|
|
I'm a bit on thin ice here, but if your program is a Unicode build, you can try to use the wide version of CreateFile, CreateFileW().
Else, convert the string to ANSI and use CreateFile()
Or, do an ANSI build (by removing the UNICODE define(s)).
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
This is one problem. I tried your views and one problem is solved. But still it gives the same error in create file.
Regards
Kenny
|
|
|
|
|
Here is an article that might help you. Check out the information regarding "symbolic link name" especially. Maybe that's your problem?
http://www.ddj.com/dept/windows/184416453[^]
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
how start to a MFC code for delaunay triangulation using 10 points..?
-- modified at 0:34 Tuesday 22nd August, 2006
|
|
|
|
|
Hi, welcome to Code Project. I sure hope you become a member of our little community. If you want people to do your job for you, you would do well to show that you've taken a stab at it yourself. You've emphasised MFC, but what you're asking for is a mathematical operation. Why do you require MFC be used to do this ? What have you already done to try and solve this problem, besides asking us to do it ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I think Codeproject may need to open another section for MATHS
If u can Dream... U can do it
|
|
|
|
|
|
Christian Graus wrote: and he has no idea what he's asking for
|
|
|
|
|
what is wrong with u???
dont ever underestimate people!
|
|
|
|
|
man, you're on codeproject since today...
i don't think you have something to say against me on that board, especially when looking at your posts.
|
|
|
|
|
do u mean a maths operation cannot deal with MFC???
|
|
|
|
|
There are no specific MFC classes that deal with the maths operations.
That doesn't mean you cannot use MFC in an application that uses MFC to produce the GUI for such an application.
You could try reading Sedgwick's C++ Algorithms books, or any work on computational geometry in C or C++, which might help.
Are you looking for code that will help to draw them, or calculate them, for example?
Aside:
There are a lot of people posting on CP whose idea of a good question is:
I have to do X. Please send me code.
There are several things wrong with this approach. Firstly, getting other people to do work for you isn't as helpful when learning to program. Sure, it's good to look at other people's code to see how they approached the same (or a similar) problem.
Secondly, most people here who answer posts are not employed by CP, and provide help for free, because they are generous souls, so antagonising them doesn't get you anywhere. If someone complains about my posts, for instance, I tend to ignore further posts and questions from them. Firm, but fair, in my opinion; if you cannot be bothered to retain that thin veneer of politeness towards me, why should I care what happens to you?
Thirdly, and probably most importantly, by attempting any problem yourself, you should be learning more about it; by highlighting the areas that you are having difficulty with, rather than refusing to attempt it in the first place, you are much more likely to get positive responses, which will probably help you clear up any confusion or difficulty.
Steve S
Developer for hire
|
|
|
|
|
Damn. The site lost my post, and now you beat me to it.
Steve S wrote: There are no specific MFC classes that deal with the maths operations.
*grin* I was trying to bring the OP around to that conclusion, assuming he/she has any idea what MFC is at all.
And I have to admit, you gave a better answer than I did.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
*sigh* What is MFC for ? What does it do ? What does it offer ? How would you use MFC to write maths code ?
The reason you're getting the response you are is that
1 - you're asking for someting complex
2 - you show no sign of understanding basic things and
3 - it seems probable that you've asked this without trying to do any research of your own, which means that
4 - you're hoping we will do your homework or paid work for you, for free.
We're happy to help. Helping means you do something, too. Do you know what MFC is/does ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
actually, i did two projects using C++ n MFC.
both require maths algo in it.
but i have no idea how to start my 3rd project using triangulation.
u got me wrong..i never ask people to do my homework for me..
i just ask for the idea..
maybe the idea can help me to start my program. thats it!
thanx anyway..
|
|
|
|
|
OK, perhaps you've just not made yourself clear. Either way, as has been said, MFC has nothing to do with it, standard C++ has a maths library, which you would use, and which will work in MFC.
Your first step would be to google and get info on the algorithm you want to implement. Your second step would be to write some code, based on this information. Third step is to post here when you get stuck.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Your answer like an transparent algorithm step by step
|
|
|
|
|
Do you have any code or idea?
|
|
|
|