|
|
did u try to call openport two times with two different ids?
modified on Monday, June 22, 2009 7:20 AM
|
|
|
|
|
|
jitendrapothuru wrote: hCommn = NULL;
Of course, if you only have one single handler for all your COM ports, this is not going to work. You have to use one handler for each of the COM port you want to open...
|
|
|
|
|
|
jitendrapothuru wrote: so should i have multiple handlers for multiple comports to be opened then....
hCommn= NULL is jus only initialisation na...
Is there something missing in your sentence, because I don't understand it at all ??
Anyway, are you using mutliple instances of your class or only one instance ? If you are using multiple instances of the class then it's fine but if you are using only one instance, you will "share" the handle for all COM ports, which won't work.
Later on, how are you accessing the COM port ? Please post some useful code...
|
|
|
|
|
|
So, for my other question: how many instances of the class did you create ? Show the code where you create the class.
And please use the pre tags when posting code snippets because it is almost impossible to read now...
|
|
|
|
|
|
Which class are we talking about from the start of this discussion ?
CCommnCtrl of course, the one where all your code to access your COM port is...
|
|
|
|
|
|
jitendrapothuru wrote: this is the class to open the port and i have created only one instance of the class
So, you have multiple ports but you only create one instance of the class, which means you only have one single COM handle. So, you'll only be able to access the last opened port.
If you want to manipulate multiple COM ports, you have to create one instance of the class for each COM port you want to access and use all of these instances to access the different ports (one instance of the class relates to one single COM port).
|
|
|
|
|
|
Sorry, I don't understand your question
|
|
|
|
|
|
jitendrapothuru wrote: COMMN_CTRL_CLASS *poCommunication = new COMMN_CTRL_CLASS;
Use an array, instead of a single element. Each element in the array relates to one COM port. But it is perhaps even better to use a dynamic array (take a look for instance at std::vector or std::list). Anyway, how are you accessing one particular port later on ? How do you know that you have to read data from the first port for instance ?
|
|
|
|
|
My application will take the parameters like comport name, baud rate, stopbits from the commnsettings dialog box in the application first and then it will try to open those ports. so settings dialog box will take the settings from the user and send it to my main application and then that port will be opened. so i tried to implement using an array to take the values of multiple comports first which i failed using the for loop which is going into an endless loop since its getting intialised everytime i press ok button in settings dialog box.
|
|
|
|
|
By the way, why did you delete your previous messages ? Now, nobody can't help you amymore...
|
|
|
|
|
Hi,
Using MFC application, i need to input an xml schema to an MFC exe and i need to generate xml file as an output from the specified schema. I need to do this only in MFC application.
Please suggest me some resolution as how to generate xml from schema using MFC application?
Regards,
Hema K
|
|
|
|
|
It really depends of what you are trying to achieve. I suppose your xsd has a well defined structure otherwise there is no possible way for your MFC application to magically generate the data that is required to fill your xml file.
In that case, what you could do is use a tool to generate classes based on your xsd file (which is called "data binding"). Those classes are added to your project sources and you manipulate them in your MFC application. Once the user has entered the data and you filled the different classes with the user data, you simply use the same library to serialize them into an XML file.
You can for instance look at CodeSynthesis[^], which is a free tool.
If that doesn't answer your question, then please provide more information about what you are trying to achieve.
|
|
|
|
|
Hi,
My schema file is very large and it contains so many particles, elements and attributes. The data binding provides so many classes for an single schema file. I have several schema files like this. Code will be very complex if i start doing data binding for all the schema files. Is there an Generic utility or Generic API in MFC so that it accepts any schema file and it can create an xml file from specified schema.
Regards,
Hema K
|
|
|
|
|
hemamerp wrote: Is there an Generic utility or Generic API in MFC so that it accepts any schema file and it can create an xml file from specified schema.
This doesn't make sense: you need to have some data to fill your xml file. The xsd only specifies the structure of your final xml file, but you still have to provide the data yourself. So, from where is this data coming from ?
|
|
|
|
|
Hi,
I wanted to use 3DES encryption in my C++/VC++ code for encypting an XML string. Could anyone please point me to some open source library which I could use directly instead of developing it all over again.
Thanks in advace.
|
|
|
|
|
You don't need a open source library, Windows has Cryptography API [^] providing triple DES algorithm.
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
[My articles]
|
|
|
|
|
How to specify 3DES while using EncryptMessage() API. Could you please share the code snippet if you have one.
|
|
|
|