|
Yes, it is:
file.read((char*) memblock, count);
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I have an app written in CodeGear C++ Builder 2007 which uses a COM port. If I run this app on an XP-system (my laptop) and I set the programm to use COM6 (USB->Serial) the app works fine. If I copy the app to a XPe environment (without C++) I get system error 2 (FILE NOT FOUND) if I try to create the COM connection (with FileCreate).
Is there a difference in the naming of the ports in XP and XPe, and if so, what do I have to do to solve this?
When I run the programm from the Programming environment, it creates an exe file. I copy the exe and all the files/directories in this directory to the XPe environment, and until now it didn't cause any problem, but maybe I have to it in an other way?
|
|
|
|
|
XPe ? XP Embedded ?
Did you check that the COM port is the same on the other machine ? If you use a USB to serial, the port number might change from PC to PC.
What is the complete string that you are using to open the com port ?
|
|
|
|
|
XPe = XP embedded.
It is not the same COM port (On laptop with USB to Serial on COM 6; On XPe system on COM2) I've changed that before moving the app.
<br />
char portName[] = "COM6";<br />
hComm = CreateFile (portName,GENERIC_READ|GENERIC_WRITE,0,0,OPEN_EXISTING,FILE_FLAG_OVERLAPPED,0);<br />
|
|
|
|
|
I didn't use XP embedded before but I used winCE (but there, the binaries are different so you need to compile your code specifically for winCE).
As far as I remember, you have to specify the port name this way on WinCE:
char portName[] = "\\\\.\\COM6";
If that doesn't work, check also with a colon at the end:
char portName[] = "COM6:";
|
|
|
|
|
Cedric Moonen wrote: char portName[] = "\\\\.\\COM6";
did it, but now I am doubting myself... I believe I've tested this solution but I'm not sure anymore.
Anyway... thanks
Frank Peeters
|
|
|
|
|
Cedric Moonen wrote: As far as I remember, you have to specify the port name this way on WinCE:
char portName[] = "\\\\.\\COM6";
I thought this format was required only for COM ports 10 and higher.
"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'm writing a SDI windows win32 .exe program using Visual C++ 6.0. If in the future I want the program to run on PCs other than with the Windows Operating system, is there anything I should incorporate into the code now, or is it compatible with most other operating systems already, or does it need to be rewritten?
Thanks!
|
|
|
|
|
I've not used it myself, but if you're using fairly plain win32 code (ie, not wacky libraries), then you may be able to use WINE to run your program on linux (or maybe most unices).
You may also want to look at some llibraries like Qt (off the top of my head) which are on most systems, so you'd just need to recompile for a different OS.
If your program does clever algorithmic things, you could make that part OS independent, and write OS dependent front ends...
Lots of choices!
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Visual C++, MFC, Win32, etc., are from Microsoft and they are specific to develop software for Microsoft Windows.
If you need tools to write a cross platform program, have a look at the following URLs:
Visual Component Framework[^]
Cross Platform Programming[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
You won't be able to do that. MFC is for windows only. Anyway, even if your code was 100% system independant, you still would need to recompile it for a different platform (the binaries are totally different).
If you want to make something portable, you will need to make your code portable, you will need to get rid of every call to the win32 API (and get rid of MFC, completely). However, don't panic, there is a cross-platform alternative to MFC: wxWidgets[^]. If you have experience with MFC, it shouldn't be too difficult to switch because it is more or less similar (in usage I mean).
Good luck, it is probably more complicated than you think...
|
|
|
|
|
Java ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
better look for library like WxWidget and QT for this, MFC is specific for windows.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
|
|
Naively: because a (raw) pointer is not an object.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: Naively: because a (raw) pointer is not an object
what is original question??
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
He was asking while relational operators cannot be overloaded for pointers.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I dont know why you delete your question?
|
|
|
|
|
indian trade secrets?
|
|
|
|
|
Oh really can I learn it of you.
|
|
|
|
|
Hello everyone,
I am designing a small budget assignment/checking application for a hierarchy organization structure. The purpose is to check and assign the budget for each employee not exceeds the total budget of a department.
The most difficult part is, a sub-department's total budget is not always lower than the upper level department's budget (i.e. the organization tree does not 100% reflects the relationship that father department node's budget is always more than that of child department node).
So, I put many exception rules to check in such situation. I am wondering whether there is any smarter ways to implement and represent the budget assignment and check model?
(I can re-write anything in this application, including data structure and algorithm, if the budget assignment and checking function is met.)
An example,
department goo under larger department foo, is represented as, /foo/goo, and /foo/zoo's budget is lower than /foo (this is a normal senses), but /foo/goo's budget is larger than /foo(this is a special rule, in the business model, even if goo under management of foo, its budget is not controlled by foo, so larger), and I maintain the remaining budget for each department,
for employee, /foo/emp1 and /foo/zoo/emp2, I can check from father node to child node for making all child nodes' budget not exceed father node, but for /foo/goo/emp3, I have to check specially. This is my headache.
If there are any smarter ways to represent the data structure and budget check, I would appreciated.
thanks in advance,
George
|
|
|
|
|
You're working on a real project? Not just technical fun?
The world is changing...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Hi CPallini,
How do you call a real project? This is an issue I met with in a C++ project, it is not homework. A couple of guys want to make something fun and cool.
Any ideas? Smart guy?
regards,
George
|
|
|
|
|
George_George wrote: A couple of guys want to make something fun and cool
Good luck!
George_George wrote: Any ideas?
Find out yourself: having ideas is the real fun.
George_George wrote: Smart guy?
Probably you're smarter than me.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|