|
|
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.
|
|
|
|
|
See, for instance [^], the encryption algorithm is specified in the CryptGenKey call.
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]
|
|
|
|
|
I'd recommend Crypto++[^]. I find (once you're used to the way it works) that it's easier to use than Windows Cryptographic APIs.
Jeffrey Walton's written quite a few very useful articles[^] on cryptography, using Crypto++ and (IIRC) the Windows Cryptographic API
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
hey,
i'm working with a function which creates a base 64 hash of a string which i enter, and then another function which verifies if the hashed data is the same as the original string. (yup its CAPICOM again ). the problem is that the sign and verify functions return _bstr_t data types and accepts UNICODE style data only. so im signing data using the sign function (which wants and returns _bstr_t type string) and then i verify it (again returns a bstr_t type) but it fails at verifying. i googled it a lot and someplaces say its because CAPICOM only works with UNICODE data. so my question: how do i pass in the bstr_t string as a UNICODE?
edit: I guess I misinterpreted the displayed value of 0...
|
|
|
|
|
Well, bstr_t encapsulates BSTR strings, that, roughly speaking are OLECHAR * , finally OLECHAR are WCHAR , i.e. wide char. The point is: bstr_t represent a UNICODE string so, what is your problem? Could you please post the relevant code?
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]
|
|
|
|
|
lol u asked for it i don't know how familiar you are with the CAPICOM functions but this is bascially the code and below is what i want the outcome to be:
<pre>
CAPICOM::ISignerPtr signer(__uuidof(Signer));
CAPICOM::ISignedDataPtr sigData(__uuidof(SignedData));
sigData->Content = "Data to Sign";
_bstr_t sigStr = sigData->Sign(signer,true,CAPICOM_ENCODE_BASE64);
cout<<"\n\nVerified String: "<<sigData->Verify(sigStr, true, CAPICOM_VERIFY_SIGNATURE_ONLY)<<endl;
</pre>
This code sets the content to be signed to "Data to Sign", and creates a hash with the signer's private key(can be displayed by cout<<sigStr;). in Verify function it should (it does in java) display the decrypted string (i.e "Data to Sign" on the console, whereas I'm getting a 0 on my end ). I read the article http://www.codeproject.com/KB/security/CapicomUTF8.aspx and it mentioned that fact that it wants unicode. uh... hope that helps you figure out what i'm trying to say...
|
|
|
|
|
sadman89 wrote: sigData->Content = "Data to Sign";
Why don't you use
sigData->Content = bstr_t(L"Data to Sign");
?
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]
|
|
|
|
|
ok i tried that (and _bstr_t(..)) still the verification is displaying a 0 i guess the cast(?) is fundamentally correct, but its still not giving me the expected output. I also looked at the excellent http://www.codeproject.com/KB/string/cppstringguide2.aspx for some new ideas but no luck darn this COM and the lack of help from Microsoft
modified on Monday, June 22, 2009 4:01 AM
|
|
|
|
|
Can anyone explain how to change the forms and other controls are look and feel (Runtime) in vc++?
|
|
|
|
|
Hi suthakar,
You can call the ModifyStyle or ModifyStyleEx to update ur window styles dynamically.
Alternative is to use the SetWindowLong family of functions (as documented in MSDN)
to change the style byte values, and update the window accordingly.
Just be sure that your style values are compatible with the way ur using ur dialogs/forms.
|
|
|
|
|
Hi Tyrion,
Thanks for your information.Extented that shall i add themes like office2007 styles or VISTA styles to dialogs and forms?Is there any provision for adding those themes?
|
|
|
|
|
You need to customize your control (WM_OWNERDRAW) you can find examples for each control on the codeproject.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
yup i agree with hamid, WM_OWNERDRAW gives u full control over the drawing operations.
and sorry but i`m not too familiar with the newer Vista and Office 2007 styles
|
|
|
|