Re: Looking for all Control Masters!! problem with # import (evc3.

From: Anthony Marchini (marchini_at_am_r_c.nl0ckerd0tcom)
Date: 07/14/04


Date: Wed, 14 Jul 2004 17:35:15 -0400

Ok, I think I see where I am at.
I assumed that _GUID was a identifier for the struct but it is actually a
#define somewhere else as well.
So I did a search on the directory and about 100+ _GUID definitions showed
up.
So now I guess I have to wade through them and see which won is relevent (or
perhaps there is one included with the control I need to use...just thought
of that.... GUID, its the ID of the control isn't it...I bet that is it.)
Well, I will look around some more.
Tony

"Anthony Marchini" <marchini@am_r_c.nl0ckerd0tcom> wrote in message
news:emUkBneaEHA.2972@TK2MSFTNGP12.phx.gbl...
> Ok,it isn't that the IID_NULL isn't found its that its root structure
can't
> be linked.
> I screwed up and called a link error a compile error.
>
> HostPort.obj : error LNK2001: unresolved external symbol _GUID_NULL
>
> Which library is this in? Is there a method of finding this out?
> Thanks for all your help so far by the way.
> Tony
>
>
>
> "Alexander Nickolov" <agnickolov@mvps.org> wrote in message
> news:ec8fsgeaEHA.3112@tk2msftngp13.phx.gbl...
> > As long as Control in your code is an IDispatch pointer, this
> > should compile. Again, I can't comment for eVC. Try GUID_NULL
> > if IID_NULL is not found.
> >
> > --
> > =====================================
> > Alexander Nickolov
> > Microsoft MVP [VC], MCSD
> > email: agnickolov@mvps.org
> > MVP VC FAQ: http://www.mvps.org/vcfaq
> > =====================================
> >
> > "Anthony Marchini" <marchini@am_r_c.nl0ckerd0tcom> wrote in message
> > news:ObO4lYeaEHA.3988@tk2msftngp13.phx.gbl...
> > > ARG...just realized I am top posting... I hope I don't go to Newsgroup
> > heck.
> > >
> > > Anyways, I was wondering this,
> > > can I,...inside a DLL call a control using one of these
> > >
> > > dispResult = Control->Invoke(Propindex,IID_NULL,
> > > LOCALE_USER_DEFAULT,DISPATCH_PROPERTYPUT, spParams, NULL, NULL, NULL);
> > >
> > > where Propindex is the number of the property (which I know from
looking
> > at
> > > the compiled Control) and somehow can setup the spParams structure.
> > >
> > > The idea is to pass some kind of Handle (the object itself) to the DLL
> and
> > > use this function to (in this case), put a value in the propery.
> > >
> > > I had tried something like this and I got pretty far it seemed but I
> > > couldn't get the IID_NULL param to compile in.
> > >
> > > My DLL is primative, to say the least, so I am really making a lot of
> work
> > > out of this by not using "the normal tools" but I can understand this
> > level
> > > pretty well and if I can get the above to work once, well then I can
get
> > it
> > > to work in other cases as well.
> > >
> > > T.
> > >
> > >
> > > "Alexander Nickolov" <agnickolov@mvps.org> wrote in message
> > > news:OiQCICcaEHA.1248@TK2MSFTNGP11.phx.gbl...
> > > > The control in question does not export a dual interface - only
> > > > IDispatch, so the OP would have to use CComDispatchDriver.
> > > > #import is simply unnecessary in that case.
> > > >
> > > > --
> > > > =====================================
> > > > Alexander Nickolov
> > > > Microsoft MVP [VC], MCSD
> > > > email: agnickolov@mvps.org
> > > > MVP VC FAQ: http://www.mvps.org/vcfaq
> > > > =====================================
> > > >
> > > > "Steve S" <SteveS@discussions.microsoft.com> wrote in message
> > > > news:C5E11E34-0226-4F08-A009-731C10730FC5@microsoft.com...
> > > > > You could try adding raw_interfaces_only to the #import line,
> deleting
> > > the
> > > > TLI and TLH files, then recompiling. Bear in mind that you would
then
> > have
> > > > to use raw interfaces, which means checking your HRESULTs, dealing
> with
> > > raw
> > > > types like BSTRs and so forth (although it's not *that* hard). As
I'm
> > not
> > > > using eVC++ at the moment, I can't guarantee it will work, but you
> never
> > > > know, it might...
> > > > >
> > > > > Steve Spencer
> > > > >
> > > > > "Anthony Marchini" wrote:
> > > > >
> > > > > > I attempted to add comdef.h to the stdafx.h section but it
didn't
> > > work.
> > > > > > I then tried to add it to the .tli file that the #import
generated
> > but
> > > > that
> > > > > > didn't seem to help either.
> > > > > > My guess is that a major switch in the setup needs to be
flipped,
> > and
> > > I
> > > > > > don't have nearly enough experience to flip it manually.
> > > > > > Tony
> > > > > >
> > > > > > "Alexander Nickolov" <agnickolov@mvps.org> wrote in message
> > > > > > news:uePpteSaEHA.3352@TK2MSFTNGP12.phx.gbl...
> > > > > > > From comdef.h:
> > > > > > >
> > > > > > > HRESULT __cdecl
> > > > > > > _com_dispatch_method(IDispatch*, DISPID, WORD, VARTYPE, void*,
> > > > > > > const wchar_t*, ...) ;
> > > > > > >
> > > > > > > Note, I don't know if this exists in eVC, might be a missing
> > > > > > > feature. If that's the case, forget about #import and use
ATL's
> > > > > > > CComDispatchDriver instead (if it exists in eVC that is...).
> > > > > > >
> > > > > > > --
> > > > > > > =====================================
> > > > > > > Alexander Nickolov
> > > > > > > Microsoft MVP [VC], MCSD
> > > > > > > email: agnickolov@mvps.org
> > > > > > > MVP VC FAQ: http://www.mvps.org/vcfaq
> > > > > > > =====================================
> > > > > > >
> > > > > > > "Anthony Marchini" <marchini@am_r_c.nl0ckerd0tcom> wrote in
> > message
> > > > > > > news:O4abAHSaEHA.2544@TK2MSFTNGP10.phx.gbl...
> > > > > > > > I am attepting to connect to a Control from inside my DLL. A
> > > little
> > > > > > > surfing
> > > > > > > > the net tells me that if I add this to my DLL
> > > > > > > >
> > > > > > > > //{{AFX_INSERT_LOCATION}}
> > > > > > > > // Microsoft eMbedded Visual C++ will insert additional
> > > declarations
> > > > > > > > immediately before the previous line.
> > > > > > > > #import "dbcontrol.dll" no_namespace named_guids
> > > > > > > >
> > > > > > > > Then the IDE will create the wrapper functions for me. So I
do
> > > this
> > > > and
> > > > > > > the
> > > > > > > > the compile fails.
> > > > > > > > Undeclared identifier.
> > > > > > > > So I look at the error and start searching for the problem.
> > > > > > > > The Import created the following type of wrapper
> > > > > > > >
> > > > > > > > inline void _DControl::PutItem ( short SizeCode, const
> > _variant_t
> > > &
> > > > > > > _arg2 )
> > > > > > > > {
> > > > > > > > _com_dispatch_method(this, 0x3d, DISPATCH_PROPERTYPUT,
> > > VT_EMPTY,
> > > > > > NULL,
> > > > > > > > L"\x0002\x000c", SizeCode, &_arg2);
> > > > > > > > }
> > > > > > > >
> > > > > > > > only, after doing this it is telling me it has no idea what
> > > > > > > > _com_dispatch_method is. So I figure I will look for this
> thing
> > > and
> > > > I
> > > > > > find
> > > > > > > > "NO" mention anywhere for this thing (_com_dispatch_method).
> > > > > > > > Where did it get this thing? I searched the Control source
> > > > (purchased
> > > > > > from
> > > > > > > a
> > > > > > > > third party) and found nothing.
> > > > > > > >
> > > > > > > > I need to know why this thing generated wrappers it can't
> > compile?
> > > > > > > >
> > > > > > > > My ultimate goal is to have my DLL operate this Control. The
> > > control
> > > > is
> > > > > > > > already activated by the eVB program that is using it. What
I
> > need
> > > > is my
> > > > > > > DLL
> > > > > > > > to get things out of it directly so I don't have to waste
time
> > > (and
> > > > > > > effort)
> > > > > > > > copying things from the control, to my DLL.
> > > > > > > >
> > > > > > > > Tony
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: Looking for all Control Masters!! problem with # import (evc3.
    ... I assumed that _GUID was a identifier for the struct but it is actually a ... So I did a search on the directory and about 100+ _GUID definitions showed ... > I screwed up and called a link error a compile error. ...
    (microsoft.public.win32.programmer.ole)
  • Re: re[2]: Com object questions
    ... I took a look at the code that generates the Record info, ... records that don't have a guid ... Looks like it should be possible to create a python record object from ... and when I try to use a struct for the IP address using the following code: ...
    (comp.lang.python)
  • advanced? marshaling
    ... GUID guid; ... typedef struct _CONNMGR_CONNECTIONINFO { ... DWORD dwParams; ... ULONG ulMaxCost; ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Design issue: Struct vs. Class
    ... > After reading the thread "Struct faster than class?" ... > Most are int type values but this one meta data is full of Guid. ... No perticular reason, just to make it look different while ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Design issue: Struct vs. Class
    ... Most are int type values but this one meta data is full of Guid. ... enum supports int etc and not string or Guid so I endup making it a Struct. ... No perticular reason, just to make it look different while programming (as ...
    (microsoft.public.dotnet.languages.csharp)