|
How did u declare the typedef in IDL? You are getting a warning MIDL2368 or some error?
If it is a warning MIDL2368 it is expected and irespective of this warning ur structure declaration will work fine on the client.
Below given is a valid structure defenition.
typedef [uuid(7175259D-025D-429e-B487-A325331FA628), version(1.0)]<br />
struct tagemp {<br />
[helpstring("name")]<br />
BSTR name;<br />
[helpstring("age")]<br />
short age;<br />
} emp;
You have to declare it in the library block.
rgds...mil10.
|
|
|
|
|
I'm upgrading a project to make it support UNICODE (instead of MBCS). This project used std::ofstream of the STL so I've tried to replace it with wofstream but it does not work.
The old version:
void COrb::GetServer(std::string Name)
{
std::string file;
ofstream iorFile;
iorFile.open(Name.c_str());
iorFile >> file;
return;
}
My modification:
void COrb::GetServer(std::wstring Name)
{
std::wstring file;
wofstream iorFile;
iorFile.open(Name.c_str());
iorFile >> file;
return;
}
I've read some articles and find that wofstream doesn't really support wchar_t type,so could anyone give me a solution?
Thanks a lot.
adfafafa
|
|
|
|
|
The basic_ofstream ctor that takes a filename uses a const char* parameter for the name, so passing a wstring or Unicode string for the name won't work.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
I see that basic_ofstream takes a filename of const char* parameter, so could you give me a solution to handle (open,close,read,write) a file which has a UNICODE string filepath using std::iostream.
Thanks a lot for ur advice.
adfafafa
|
|
|
|
|
I'm trying to write a IE - Browser-Helper-Object but i have now idea, how to add an icon to the status bar. I would like to indicate activity of the BHO with a small LED in the lower left of the IE this way....
|
|
|
|
|
How can I hide the export information of my DLL, such as function name or class name?
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
Simon.W wrote: How can I hide the export information of my DLL, such as function name or class name?
Simply don't export the functions or classes.
|
|
|
|
|
There're two dialogs, one is IDD_DLG1, the other is IDD_MAINDLG, I want to make IDD_DLG1 shown in IDD_MAINDLG, for example, in the middle of the IDD_MAINDLG.What should I do?
-- modified at 4:48 Tuesday 18th April, 2006
|
|
|
|
|
Can any one suggest me where to find quality study material on ATL
thanx
|
|
|
|
|
|
how to show a button which will create in seprate dll ,
in detail:
i am calling a DLL in which a button is created but i want to show this button on my main dialog please tell me what i have to do for this.
Bankey Khandelwal
Software Engineer
Bankey Khandelwal
Software Engineer
|
|
|
|
|
any particuliar reason to repost/cross-post the forums ?
i believe David[^]'s answer didn't satisfy you
anyway, '1' for the offense.
|
|
|
|
|
Hi,
I created a generic ATL COM Dll with an Interface and Event. I'm having trouble setting it up to receive the event notification in my client container of a console application. I tried adding a class derived from IDispEventImpl and added the Event Sink map. Anyone know the correct steps in doing this?
Regards,
|
|
|
|
|
Hello Anthony9887,
Can you be more specific about the trouble you are facing ? For example, does your application crash when it is supposed to receive the event ? Does your application termiate before the event is received by the sink ?
The correct steps to resolve your problems may depend alot on the nature of your problem.
Thanks,
Bio
|
|
|
|
|
Hi, I am having errors.
error C2664: 'Menu::createMenuItem' : cannot convert parameter 3 from 'std::_Vb_reference<_MycontTy> *__w64 ' to 'bool *'
...
vector<bool> connect_flags;
vector<bool> disconnect_flags;
...
for(int j=0;j<gmenustate.getsizeofgosafestations();j++)
{
this-="">pMenu->createMenuItem(mhComm, (connect_str+gMenuState.getGosafeStation(j).name).c_str(),
&(gMenuState.connect_flags[j]), &_menuHeaderCommFn);
this->pMenu->createMenuItem(mhComm, (disconnect_str+gMenuState.getGosafeStation(j).name).c_str(),
&(gMenuState.disconnect_flags[j]), &_menuHeaderCommFn);
}
Anybody can help me?
Yonggoo
-- modified at 18:50 Thursday 13th April, 2006
|
|
|
|
|
please check the Ignore HTML tags in this message (good for code snippets) checkbox so that we can see your < > stuff properly
|
|
|
|
|
Scott Meyers in his book "Effective STL" says vector<bool> is not really vector - it's a bitset and it uses proxy when you try to address an element. You cannot use it like an array.
Try different element type instead.
|
|
|
|
|
Or use std::deque<bool> instead
Orhun Birsoy
|
|
|
|
|
I have an active control which is published. Now I want to add two new methods to this control to provide new functionality. Just like COM is the activex immutable ? If yes, how do I achieve it. I mean we declare new interfaces in COM when providing new functionality and QueryInterface determines whether to use the new functionality exists or not. How can I achieve this in activex control.
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg."
- Bjarne Stroustrup
|
|
|
|
|
See my reply in the C++ forum here[^].
--
Roger
It's suppose to be hard, otherwise anybody could do it!
|
|
|
|
|
I have an atl application that uses an activex control which I create at runtime. I am currently using #import. Now I have a new version of the activex which has some new features, I would like the option of using either of them based on some config setting somewhere. Don't think #import will work in this scenario. Any help is greatly appreciated.
Kurt
|
|
|
|
|
OK, following on from the char -> wchar_t question earlier, does anyone know of a neat STL-friendly way to perform UTF8 encoding/decoding? Currently I use the MS character encoding macros, e.g.:
wstring str = CA2W(utf8_string, CP_UTF8).m_psz;
But I'd like to use something that is a bit more platform independent!
The Rob Blog Google Talk: robert.caldecott
|
|
|
|
|
AFAIK STL doesn't have UTF-8 support because the elements in a basic_string have to all be the same size, and the UTF-8 encodings of characters have variying sizes.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Never mind. You can store a utf-8 string as a sequence of bytes in std::string, just need to know which functions operate correctly on such a sequence and which not.
As for the conversion, I have been writing an article on platform-independent STL friendly utf-8 string operations for months, but I just can't make myself finish it
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
Nemanja Trifunovic wrote: As for the conversion, I have been writing an article on platform-independent STL friendly utf-8 string operations for months, but I just can't make myself finish it
Man, that would be sweet...
The Rob Blog Google Talk: robert.caldecott
|
|
|
|