|
I guess I have basic knowledge of COM/ATL.. Any suggestions on a good book to learn more COM/ATL (intermediate/Expert level).
Thanks
|
|
|
|
|
Hello, see my answer to Nish
COM ATL BOOK
Cheers,
Joao Vaz
A person who is nice to you, but rude to the waiter, is not a nice person - Natalie Portman (Padme/Amidala of Star Wars)
|
|
|
|
|
ATL Internals by Brent Rector and Chris Sells if you want to learn ATL.
Essential COM by Don Box if you truely want to understand COM.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
My server application retrun variant and can have any one of data type int, bstr, date, ulong,
I am able to fetch all the value that is returned by VC server except ULONG value from my VB client application.
Please tell me that is there is any way to get ULONG value from variant in Visual basic.
Regards
|
|
|
|
|
ULONG is not a compatible type with VB. Try using CInt function to see whether it works or return the ULONG as long from the server
|
|
|
|
|
I've developed a DCOM component that accesses database by ODBC.
The problem is that if I use Interbase database I can't open the database.
I've made a component on Delphi and when I've tried to access it remotly an error is returned which says the table doesn't open.
When I've made the component on VC++ an error returns saying a denied access message.
When I've used MS Access database just changing the ODBC alias, everything works well.
The error has occured only when I've accessed the component through DCOM and hasn't occured when I've accessed it locally, through COM.
One of the customer's requirements is that the database MUST be on Interbase, and not on MS Access. Because of that I've needed an ODBC driver for Interbase that could be accessed remotely through DCOM.
Thank you in advance.
Katiúcia Freitas da Silva
e-mail: katiucia@inatel.br
ICQ#: 127458845
|
|
|
|
|
How is the DCOM component running as a service or a a local server?
If it is running as a service try making it run as a distinguished user.
For a local server try running it as the interactive user.
|
|
|
|
|
Thank you very much for helping us!
Your answer has helped us to solve our problem.
You've got all what we needed.
Katiúcia Freitas da Silva
|
|
|
|
|
I need to pass some structure information from a method of an interface. I think i should use a VARIANT to make it run in VB, because it doesn't support ** pointers.
Do you know how?
rechi
|
|
|
|
|
It depends what it is you are trying to pass. You could use a VARIANT * (VT_BYREF | VT_VARIANT)
|
|
|
|
|
It doesn't work. The code that fails in VB is:
STDMETHODIMP CInterface::Method(VARIANT *ppp)
{
TestStructure *p=new TestStructure;
p->Value=10;
ppp->vt=VT_VARIANT | VT_BYREF;
ppp->pvarVal=(VARIANT *)p;
return S_OK;
}
What is wrong?
rechi
|
|
|
|
|
First define structure in IDL file (Example):
typedef struct MY_STRUCT
{
long lVal;
BSTR wsVal;
} _s1;
[
object,
uuid(BC922B3D-682B-11D6-A110-00B0D0C3D9BD),
dual,
helpstring("ITest Interface"),
pointer_default(unique)
]
interface ITest : IDispatch
{
[id(1), helpstring("method Foo")] HRESULT Foo([in,out] _s1 *sOut);
};
[
uuid(BC922B31-682B-11D6-A110-00B0D0C3D9BD),
version(1.0),
helpstring("ForVB 1.0 Type Library")
]
library FORVBLib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
[
uuid(BC922B3E-682B-11D6-A110-00B0D0C3D9BD),
helpstring("Test Class")
]
coclass Test
{
[default] interface ITest;
};
};
C++ implementation of the function returning that structure to VB app.
STDMETHODIMP CTest::Foo(_s1 *sOut)
{
if(!sOut)
return E_POINTER;
sOut->lVal = 12345;
sOut->wsVal = ::SysAllocString(L"Some string.");
return S_OK;
}
This is VB code to get the structured data:
Private Sub Command1_Click()
Dim s As FORVBLib.MY_STRUCT
Dim obj As FORVBLib.Test
Set obj = New FORVBLib.Test
obj.Foo s
End Sub
soptest
|
|
|
|
|
The following code works fine..
CoInitialize(NULL);
m_cRichEditCtrl.Create(ES_READONLY, rect, GetDlgItem(IDC_G), 1);
However the following fails..
CoInitializeEx(NULL, COINIT_MULTITHREADED);
m_cRichEditCtrl.Create(ES_READONLY, rect, GetDlgItem(IDC_G), 1);
I remember having read somewhere that RichEdit control uses OLE (ie CoInitialize(NULL)). Is that the problem ?
Any solution ? Thanks
|
|
|
|
|
|
|
Yes I did..
Should I put "AfxInitRichEdit" Before or After CoInitialize..
Thanks
|
|
|
|
|
Is there somewhere a tutorial of about how does the pluggins are created to Internet explorer. What is the specific for that - registry entries, implementing interfaces...
|
|
|
|
|
RegSvr32: LoadLibrary("\Xyz.dll") failed
GetLastError returns 0x000003e6
Using VC++5.0. Thanks
|
|
|
|
|
0x000003e6 = "Invalid access to memory location."
Like it or not, I'm right.
|
|
|
|
|
Thanks for your response. I looked at the winerror.h and I found out about what error means etc.
I am looking for a solution ?
|
|
|
|
|
I'm looking for a pointer in the right direction, if someone can help.
I need to create an ActiveX control which displays in a frame window and which can be hosted by IE. In other words, rather than a control which sits on the web page's background, I need the control to pop up in its own frame window. As various events happen on the web page, custom methods / properties on the control will be invoked. All the ATL samples and other examples I can find which have a UI / GDI aspect to them just sit on the web page's background. So I'm not sure the best way to go about this.
It would seem that, after creating an ATL project and adding an ATL ActiveX control, there are two options: 1) modify the generated code in the control to somehow make it a window with a frame that floats outside the browser's window. I'm not sure if that's feasible given that IE controls the window's creation and its initial style settings. 2) Make the control that IE knows about UI-free but have it create a frame window / control and perhaps delegate custom interface methods on the "main" control to this control. That seems feasible, but it always helps to see something nominally similar as a starting point.
If anyone could point me to an example or some docs that cover this type of control, I'd appreciate it.
Thanks,
Donnie
|
|
|
|
|
Design you ActiveX as singleton and run that ActiveX in another IE window. By creating an instance of that object you always will have only one shared instance.
soptest
|
|
|
|
|
I'm looking for a free alternative to ATL. Some sort of COM wrapper library that can be used with a free compiler like MingW or Borland C++. Is there such a thing?
|
|
|
|
|
Yeap, there is, but is in beta stage
COMET
It's look promising, it only have a macro !!! The code uses templates instead to do message dispatching
Cheers,
Joao Vaz
A person who is nice to you, but rude to the waiter, is not a nice person - Natalie Portman (Padme/Amidala of Star Wars)
|
|
|
|
|
Interesting, I'll take a look at it. Thanks.
|
|
|
|