|
Hm.
error C2039: 'Detach' : is not a member of '_bstr_t'
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
did you include comutil.h ?
-prakash
|
|
|
|
|
Of course I did! : ). Anyway, the right way to do it is _variant_t, just thought you people want to know. With that it works ok, even if there are still some minor issues.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Axonn Echysttas wrote: Anyway, the right way to do it is _variant_t
ofcource I know that, But since BSTR worked for you in the first place I was keeping the solution simple for you.
-prakash
|
|
|
|
|
Ehm. You really need to read this[^] and this[^], because you're really on thin ice (about 40 Angstrom thick) when it comes to string handling right now...
--
|
|
|
|
|
Thanks. Yeap, I looked over it and I found the _variant_t type to help me. However, I would prefer being able to use the basic types such as LPCWSTR to solve the problem. Sending LPCWSTR to VB works but if sending un-even number of characters such as "a" or "abc" it adds that | character at the end. If I could solve this in an easy way it would be perfect.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
You get the errors most likely because you are forcing an ASCII string into SysAllocString(). Try this instead: SysAllocString(L"This is a wide string") . Notice the L-prefix?
If you are using MFC7/ATL7.x, you could use CComBSTR() as it takes an ordinary ASCII string as parameter in one of its constructors. Otherwise, please look up the function MultiByteToWideChar() which performs ASCII -> wide for you.
Also, please be wary when dealing with BSTR strings. They are not regular wide strings as the articles I mentioned above says.
--
|
|
|
|
|
Yeah, it's pretty weird. I get a thousand weird issues while working with Strings from VC++ to VB. Very annoying.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Right or wrong I use LPCSTR all the time. I suppose even LPSTR would work also.
Works without any issues.
DEBUGGING : Removing the needles from the haystack.
|
|
|
|
|
Hi Gurus,
I am just trying out to build an application where DirectShow is used for capturing video and audio file.
I have used the Graph Edit given in DirectX9.0 and tried out the concept.
But when i create an application
ICaptureBuilder2 interface and video compression and video capture device and AviMux interface are created or retrieved correctly.
But when i try to use
ICaptureBuilder2 *pBuilder;
IBaseFilter *pVideo;
IBaseFilter *pCompressor;
IBaseFilter *pMux;
// Assume all the above filters are instatiated and retrieved.
HRESULT hr= pBuilder->RenderStream(&PIN_CATEGORY_CAPTURE,&MEDIATYPE_VIDEO,
pVideo,pCompressor,pMux);
It fails becoz it cannot connect the right pins.
I know that a smart tee filter is inserted after the capture device because of the Intelligent Connect properties.
I am somehow not able to connect the compressor in between.
Can someone help me and clearify what i should do.
thanks in advance
Sumit
|
|
|
|
|
how should i change the size of a window.?? i want to do it in my code.
|
|
|
|
|
hamidreza_buddy wrote: how should i change the size of a window.?? i want to do it in my code.
SetWindowPos[^]
-prakash
|
|
|
|
|
MoveWindow(),CenterWindow(), these might help you along with
CalcWindowRect().
|
|
|
|
|
hi
i want to use an .ocx control in my application. how should i embed it ??
plz help. just say what resources do i need to study to do it?
thx
|
|
|
|
|
If you are developing a MFC application embedding a control is quite simple. You simply have to register it and then add it to your project. Using the class wizard you can easily do the rest, access methods and properties or catch events.
You can find an example here
|
|
|
|
|
Hai..
GetKeyNameText function returns the name of the key pressed in the keyboard. It works fine for the English lanuguage. Now i changed to Language setting to Japanese. If i press a character in the keyboard that should give the japanese name of the character i have pressed. Is there any function works like that?
Please let me know any body have idea.
Regards
Raghavendra
Raghavendra
|
|
|
|
|
Maybe because the keyboard itself was not changed to Japanese, you still get the 'English' names for the keyboard. Try using a Japanese keyboard with a Japanese OS language setting and see if your results are better (you might even need the Japanese version of Windows installed specifically). As I recall, the keyboard names come from the keyboard driver, not from Widnows itself, therefore, if you do not change the keyboard driver out, then you will get names matching keyboard, regardless of the OS localization setting.
|
|
|
|
|
object* Function()const;
when are they called? whats their use? please explain the syntax someone
rahul
|
|
|
|
|
|
Consider we have a class CFoo
CFoo
{
protected :
char* m_sText;
public :
char* getText() const;
}
char* CFoo::getText() const
{
return m_sText;
}
By writing const keyword we make sure that CFoo::getText function does not modify the object for which it is called.So we can't write inside , for example :
char* CFoo::getText() const
{
m_sText="Hello";
return m_sText;
}
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
its a constant function, that can't modify variables with in that function, the compiler will raise an error on that situation.
Ninety-eight percent of the thrill comes from knowing that the thing you designed works, and works almost the way you expected it would. If that happens, part of you is in that machine.
|
|
|
|
|
Hi all,
I have been working in VC++. But I got some basic dobts to be cleared. That is the difference between Win32 application and MFC. I got the "Programming Visual C++" book (its more of MFC) . Can any one suggest me for a good book for win32 application learning. As of i know win32 is the base for MFC. Is "Programming windows by charlespetzold" is it for learning win32 application??? Could anyone help me the difference between MFC and win32?? And provide me some good meterial for that.
Thanks in advance.
|
|
|
|
|
|
Hi,
I have read that article already. I want to know more about it. My question is that Is the 'programming windows by charlesPetsold' book for win32 application?? Could u sujjest me some good books on it.
|
|
|
|
|
PREVIOUSLY IN THE EARLIER VERSIONS OF VC++...i mean vc++5.0 and so the applications were win16 but still they were called mfc as they use windows programming compileres.
in win32 or win16 all the related code should be written by the programmer.
where as mostly mfc's have built in procedures and functions that are generated by wizard.
examples for win32 are console applications,api...etc
all the win32 applications can also be called as sdk.
(software development kit)
if u really want to rule win32 and mfc my suggestions is to view the generated code in mfc's and try to write that code seperately using win32 applications.
happy coding.
Asif
|
|
|
|