|
Getting value from stuff you don't own is a compelling
idea. Just think, someone else has created something
that has value, and has made it available to you. You
can now leverage its value in ways that makes all
parties richer. That's the promise of web services.
You need to know about web services. The advent of
standards-based web services marks a new era of
system development. First mainframe, then client-server,
the Web, now web services makes it possible to leverage
every legacy system of the past and do so much more
with your information assets.
Architag Press, a division of Architag International
Corporation, announces the publication of Web Services
Implementation Guide, Volume 1: Getting Started, by
Brian E. Travis and Mae Ozkan.
Sample chapters of the book is available at
http://www.architag.com/press/wsig.
This book will show you what a web service is, and
how you can align your internal systems and external
trading partner interactions to take advantage of this
new concept in system integration.
You will learn about the "Three Steps to Web Services":
* Automate internal systems
* Determine integration points
* Expose integration points as web services
This book is for systems architects, developers,
and I.T. decision makers.
Highlights in this book:
* Written in a light, entertaining style.
* Emphasis on architectural design for web services.
* A tutorial on the state of web services standards.
* Plenty of real-life examples of web service use.
* Tutorials on the key technologies: XML, SOAP,
WSDL and UDDI.
* Code samples of key XML-based web services
technologies and extensions.
* Companion Web site with all code samples and
late-breaking information.
----
Download sample chapters of Web Services Implementation
Guide at http://www.architag.com/press/wsig/.
Stanford Powers, Publisher Architag International Corp
Phone: 866-898-0001 Outside US: +1-303-426-3126
Email: spowers@architag.com Fax: 720-294-1396
|
|
|
|
|
|
Hi,
I've been staring at this problem for hours and hours... what is wrong?!
This is what I do:
...snip...
CComModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_Lex, CLex)
END_OBJECT_MAP()
extern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID )
{
if (dwReason == DLL_PROCESS_ATTACH)
{
TCHAR pszLoader[MAX_PATH];
GetModuleFileName(NULL, pszLoader, MAX_PATH);
_tcslwr(pszLoader);
if (_tcsstr(pszLoader, _T("explorer.exe")))
return FALSE;
_Module.Init(ObjectMap, hInstance, &LIBID_LEXBHOLib);
DisableThreadLibraryCalls(hInstance);
}
else if (dwReason == DLL_PROCESS_DETACH)
_Module.Term();
return TRUE;
}
...snap...
I get this error:
---Configuration: LexBHO - Win32 Unicode Release MinDependency--------
Linking...
Creating library ReleaseUMinDependency/LexBHO.lib and object ReleaseUMinDependency/LexBHO.exp
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
ReleaseUMinDependency/LexBHO.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
LexBHO.dll - 2 error(s), 0 warning(s)
But when I comment these lines out...
...things are working just fine. What is wrong with _tcslwr? Because that's where the problems start...
Help is much appreciated,
/Tommy
|
|
|
|
|
go ot project setting and remove _ATL_MIN_CRT macro
soptest
|
|
|
|
|
Hello everyone...
I'm very much new to the COM world and I was wondering if some guru here could lead me to websites/ articles that can get me really started in COM and ATL.. I have been working with MFC for the last one year and I am already pretty realise the need for ATL and more robust prog tech..
anyway, that apart I'm also looking for a few project ideas in ATL.. this is ofcourse to add to my personal project list..
thks
yeeeeeeeeeeoooooooooooooowwwwwwwwwwwwwww
One more addition to the addiction of coding!
If you want a helping hand, you'll find one at the end of your arm.
|
|
|
|
|
before invoking the IDispacth::invoke I do the following:
BOOL CLASSNAME ::InvokeGetValue(
IDispatch *InDispatch,
DISPID& InDispId,
LCID& InLcid,
long InUserComId,
CString& OutValue, BOOL bAdhocCom, int NumToReserve, CString& Name1, CString& Name2)
{
CString strReturn;
VARIANTARG va;
EXCEPINFO exInfo;
UINT uErr;
DISPPARAMS dp;
HRESULT hr;
BSTR argConversion;
BSTR sName1= Name1.AllocSysString();
BSTR sName2= Name2.AllocSysString();
Num=32;
int nArgs = 3;
dp.cArgs = nArgs;
dp.cNamedArgs = 0;
//////???AT RUN TIME IT CRASHES ON THE NEXT INSTRUCTION
///// COMPLAINIG ABOUT UNHANDLED EXCEPTION- ACCESS VIOLATION
dp.rgvarg[0].vt = VT_I2;
dp.rgvarg[0].iVal = NumToReserve;
ANY HELP IS HIGHLY APPRECIATED.
Paradise is where I am.
Voltaire
|
|
|
|
|
did you initialize :
VariantInit(va);//your variant and
dp.rgvarg = va;//your dispparam with you variant?
access violation is often null pointer...!
|
|
|
|
|
The problem was solved by a codeguru member:
CComVariant dpv[3];
dp.rgvarg = dpv;
I was not allocating space for the dp array structure.
Thank you very much for you reply. I believe your
dp.rgvarg = va;//your dispparam with you variant?
statement was in the same general direction too.
Thanks again.
Paradise is where I am.
Voltaire
|
|
|
|
|
I'm working on a c# application and i'd like to get it launchable from Microsoft Word using a new icon. The problem is I don't know how to do, I've been searching throw articles but they often explain how to launch and control Word from an application and not the contrary.
Could someone explain me how to do such a thing, or at least give me a few steps ?
Thank you.
---------
Or not ?
|
|
|
|
|
try http://www.codeproject.com/com/outlookaddin.asp for a C++/COM article on how to write a plugin for any office application. For sample C# project, checkout MSDN for an article that got published a couple of months back.To launch your own application, you can use ShellExec in OnClick of a toolbar button in your plugin.
|
|
|
|
|
Hi everybody,
I have added a toolbar button in Internet Explorer. This button should toggle the checkbox (and write/load some values from reg) in IE->Tools->Internet Options->Connections->LAN Settings called 'Use a proxy server'.
Q1: How can I design a COM object to receive the clicks of this button and keep track of the toggle state (button pushed/not pushed) and make the button look like a toggle button?
Q2: How can design my COM object to talk with the settings mentioned above? Is it possible?
Q3: I know how to change the reg settings that IE uses each time it starts. But I need to reflect this reg settings to IE at runtime. Does any one know how to do this if Q2 can't be achieved?
Thx a lot! I have a deadline in two days and I really need to get this working by then! So please all you COM pros out there, help me if you can!
I've just started out with COM...
Thx!!!
/Tommy
|
|
|
|
|
How can I define packed structure in IDL?
Most of compilers align structure in 4/8 bytes.
IN VC++ 6.0, we can control this by using '#pragma pack' directive.
But, how can we do the same thing in IDL?
I tried to using '#pragma pack' directive in IDL like we do in c++.
It looks successful only in COM-Server Project.
Compiler-made Header file in server project has '#pragma pack' directives enclosing structure-definition.
But, client project using '#import My.tlb' has failed.
My.tlh file defines this (I expect to be packed) as unpacked structure(maybe 8byte-align).
How can I define structure as packed?
I want structure to be packed in Header files made by MIDL(includes tlh).
And, Proxy/Stub code made automatically refelcts this.
How can I solve it?
thanks~
|
|
|
|
|
Hi, I'm not completely positive as I haven't tried this, but try using the #pragma pack directive like:
#pragma pack(push, 1)
#import ...
#pragma pack(pop)
Let me know if this works for you.
Mark
|
|
|
|
|
what is the value of this and why isn't it defined anywhere?? i have the latest platform SDK...
it is referenced in the Platform SDK file: "IActiveScriptParse::ParseScriptText"
- Roman -
|
|
|
|
|
Hi, all
In Atl project ,how can I return the user define type?
For example , I have define a Struct ,and I want to return the Struct type in a function, and I plan to utilize the return Struct type in VB through the com. What should I do ? I have try some ways ,but failed.
Another similar problem. I have two ATL Object in my Atl
project , Teacher and Student . And student is a private property of Teacher ,now I want to construct a function in Teacher to return the Student property .How should I do ?
Sincerely ask for help. Who can tell me how to do , or give me some similar source code which resovle the above problems .
I'll appreciate it .
Regards.
|
|
|
|
|
Q2. You can pass the IStudent interface as well as any other data from ITeacher interface.
Q1.
In IDL-file
typedef [uuid(XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX), helpstring("Help")]
struct _SomeStruct
{
int i;
BSTR str;
...
} SomeStruct;
[...,dual,...]
interface IO : IDispatch
{
[id(1)] HRESULT M1([in] SomeStruct ss);
[id(2)] HRESULT M2([in,out] SomeStruct *ss);
[id(3)] HRESULT M3([out,retval] SomeStruct* *ss);
[id(4)] HRESULT M4([in,out] SAFEARRAY(SomeStruct) * ssbs);
};
With best wishes,
Vita
|
|
|
|
|
thank you . Q1 has been resovled following your suggestion.
but Q2 remail abcuse.
I mean I can not construct the CStudent object in CTeacher.
Details as follows.
In the construction function of the CTeacher :
CTeacher()
{
IStudent * m_student =new CStudent();
return;
}
There are some compiler errors. It says that the CStudent cannot instantiate abstract class due to following members:QueryInterface,AddRef,Release.
How should I do to resolve the problem.
thx.
Regards.
|
|
|
|
|
If you are in ATL, you have several ways to do it.
1. With the class factory of CStudent.
if( FAILED(CStudent::_CreatorClass::CreateInstance(NULL,IID_IStudent, (void**)&m_student)) )
return E_FAIL;
2. With the static method of the generic ATL CComObject.
CComObject<CStudent>* pCStudent;
if( FAILED(pCStudent->CreateInstance(&pCStudent)) || FAILED(pCStudent->QueryInterface(&m_student)) )
return E_FAIL;
3. With the original COM method.
if( FAILED(CoCreateInstance(CLSID_Student,NULL,CLSCTX_ALL,IID_IStudent, (void**)&m_student)) )
return E_FAIL;
With best wishes,
Vita
|
|
|
|
|
Hi, all
Some problems about ATL Com:
1.I have create two ATL Object: CStudent and CTeacher .
The simple source code listed as follow: (some code auto generated by ATL have been skiped)
class CStudent
{
private:
long m_age;
public:
CStudent():m_age(10)
{
}
//...other code auto generated by ATL
};
class CTeacher
{
private:
IStudent* m_aStudent;
public:
CTeacher()
{
//create an instance of the com
CoCreateInstance(CLSID_Student,NULL,CLSCTX_ALL,IID_IStudent, (void**)&m_aStudent);
}
//...other code auto generated by ATL
}
2.Then I add a "IStudent * OneStudent" property for ITeacher ,to access the m_aStudent.
The implemention of the property are listed as below:
STDMETHODIMP CTeacher::get_OneStudent(IStudent *pVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
// TODO: Add your implementation code here
*pVal = * m_aStudent;
return S_OK;
}
STDMETHODIMP CTeacher::put_OneStudent(IStudent *newVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
// TODO: Add your implementation code here
*m_aStudent = *newVal ;
return S_OK;
}
3.Now I type some VB code to test the com ,but some compiler errors occurrs.
VB Code:
Dim s As Student
Dim t As New Teacher
s = t.OneStudent
the last sentence "s = t.OneStudent" have compiler errors.
Errors:function or interface marked as restricted ,or the function use an Automation type not supported in Visual Basic
I guess the errors caused by the type dismatch between IStudnet and CStudent.But I did not know how to resolve it .
So who can tell me how to return the m_aStudent that can be supproted in vb??
thx.
Regards.
|
|
|
|
|
I think that you should implement get_OneStudent that way (and the IDL updated appropriatly):
STDMETHODIMP CTeacher::get_OneStudent(IStudent **pVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
*pVal = m_aStudent;
if (*pVal) {
(*pVal)->AddRef();
}
return S_OK;
}
You cannot copy the interface (nothing will be copied since the interface has no data in itself) and output parameter must be a [out]pointer to what you want to returns (you want to returns a IStudent * so you must use IStudent **).
Philippe Mori
|
|
|
|
|
I need to use activex dll created in vb in a C++ program. I use vc 6.
Here is what I do:
#import " MADLL1.dll" \<br />
named_guids no_implementation \<br />
raw_interfaces_only raw_native_types<br />
using namespace MADLL1;<br />
<br />
#import " MADLL2.dll" no_implementation \<br />
no_auto_exclude \<br />
raw_native_types raw_interfaces_only \<br />
named_guids <br />
using namespace MADLL2;<br />
<br />
#import " MADLL3.dll" no_implementation \<br />
no_auto_exclude \<br />
raw_native_types raw_interfaces_only \<br />
named_guids rename("SOMETHING"," SOMETHINGX") \<br />
rename(" SOMETHINGELSE", " SOMETHINGELSE X") \<br />
<br />
using namespace MADLL3;
My problem is with the third dll. I put rename because I had compilation errors.I taught It was name collision.
I did help with these variable but I have still alot of erros of the same kind:
Ex :
c:\inwork\opc_da_clientmerge\debug\OLEGEUSE.tlh(729) : error C2059: syntax error : 'constant'
enum TT_SOMETHING
{
TTDT_ONE = 0,///Here I should rename these variables
TTDT_TWO= 1,
TTDT_THREE= 2,
TTDT_FOUR= 3
};
Is it normal to rename everything? I don't think so.
Here is how I want to use the dll:
HRESULT hresult;<br />
CLSID clsid;<br />
<br />
CoInitialize(NULL);
hresult=CLSIDFromProgID(OLESTR("madll.clsConnexion"), &clsid);
if(FAILED(hresult))<br />
{<br />
<br />
TRACE_MSG(_T("CDataBD:: GetTypeAttr"),hresult);<br />
return hresult;<br />
} <br />
_clsConnexion *ConDll;
_clsError *Error;
hresult=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,__uuidof(_clsConnexion),(LPVOID *) &t);<br />
if(FAILED(hresult))<br />
{<br />
TRACE_MSG(_T("CDataBD:: GetTypeAttr"),hresult);<br />
return hresult;<br />
}
//to this point everything works
but for the rest I have to load the third dll to test it
ConDll ->LoadData("01", "L4", 0, 0, m_Line, "OLE.MachineS", ADO_OLEDB, Error);<br />
ConDll->Release();
CoUninitialize();
I also tried with IDispatch
OLECHAR* name = OLESTR("LoadData"); <br />
HRESULT hr2 = pDispatch->GetIDsOfNames(IID_NULL,<br />
&name,<br />
1,<br />
GetUserDefaultLCID(),<br />
&dispid);
Thinking I could use Invoke....
But I received :
DISP_E_UNKNOWNNAME
I'm able to use these Interfaces :
ITypeLib
ITypeInfo
I have access to info from the lib but not Invoke...
You see that I tried different approches without success.
Is it me that don't understand or could it be how the dll was created?
I have access to source code from dll but can't change anything.
Hope somebody could help me
Regards
Lily
|
|
|
|
|
Hi there,
My guess is that MADLL3 typelibrary implicitly imports typelibs of MADLL2 or MADLL1, this causes all kinds of typedefs to be duplicated in the generated .tlh and .tli files.
Gertjan
|
|
|
|
|
when make a ComAddin:
in VB
Private Sub AddinInstance_OnConnection(ByVal Application As Object,
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode,
ByVal AddInInst As Object,
custom() As Variant)
AddInInst.object = Me
End Sub
in MFC
STDMETHODIMP CMyAddin::OnConnection(IDispatch* Application,
ext_ConnectMode ConnectMode,
IDispatch* AddInInst,
LPSAFEARRAY* custom)
{
return S_OK;
}
Question is :
How to do (AddInInst.object = Me) in the MFC?
|
|
|
|
|
Please help me.
How to Call ComAddin's function from VBA MACRO?
|
|
|
|
|
I have to convert a TCHAR string to BSTR in an ATL based service without using MFC.
I tried T2OLE, but I could not compile the project because some errors:
'_lpa' : undeclared identifier, ...
Could anyone help me out?
Alma
|
|
|
|
|