|
Yes, you must make sure that the exported function have the same signature when you try to call them from delphi (i.e. make them __stdcall, _cdecl etc.)
Best regards,
Alexandru Savescu
|
|
|
|
|
Why sometimes vc++ couldn't find atlres.h ??
How to solve this problem !?
----------------------------
i am a beginner.
|
|
|
|
|
Mandalay wrote:
Why sometimes vc++ couldn't find atlres.h ??
Because you don't have WTL, or don't have the files in your INCLUDE path. See the VC forum FAQ, there's a FAQ on this topic.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
The only lame question is one that can't walk.
|
|
|
|
|
Hi All,
The prblem is as follows.
The component is an exe created using the ATL.
The client application for the component is working as expected Locally.when the component is tried for accessing from remote system, the error is generated.
The following are the setting done using the Dcomconfg tool
---On the server machine:--
1.under the "security" tab
a. "use custom access permission" option is selected and the client is added apart from the SYSTEM, INTERACTIVE & Network
2.under the "identity" tab
a. The "Interactive user" option is selected
--On the client machine--
1.Under the "General" tab
a.The "Default" option is selected from the combo box
2.Under the "Location" tab
a.Run on the following computer is selected and the remote computer name is specified.
--------------------------------------
The cleint code is as follows
In the OnInitDialog() function
////////////////////////////////////////////////////
m_host = "Wesley"
COSERVERINFO server_info;
ZeroMemory( &server_info, sizeof(server_info));
server_info.dwReserved1 = 0;
server_info.dwReserved2 = 0;
server_info.pwszName = m_host.AllocSysString();
server_info.pAuthInfo = NULL;
MULTI_QI mqi = { &IID_IDRMath,NULL, 0};
hr = CoCreateInstanceEx(CLSID_DRMath, NULL,
CLSCTX_REMOTE_SERVER, &server_info, 1, &mqi);
::SysFreeString(server_info.pwszName);
if(SUCCEEDED(hr))
{}
else if( (FAILED(hr))|| (FAILED(mqi.hr)) )
{
AfxMessageBox(IDS_E_NOCREATE, MB_OK | MB_ICONERROR);
EndDialog(TRUE);
return TRUE;
}
////////////////////////////////////////////////////
Is there any changes or addition i need to do in the code or with the DcomConfg tool?
Thanks
Chary.
|
|
|
|
|
Are you trying to create the control on a different machine on your network, or over the internet.
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!
|
|
|
|
|
Hi,
I'am trying to access the component on a remote machine on the network & not over the Internet.
The component is very simple their is no heavy business logic.It only takes the input,performs calculation & returns the value(ie like addition subtraction etc).
Thanks
Chary.
aishwarya
|
|
|
|
|
I generated an ATL Service EXE using the default wizard settings.
To this I added a CWindowImpl<> derived class. The (hidden) window is created when the service starts and receives messages from a worker thread. This all works fine as expected.
I have now added a simple ATL object through the wizard. When I try to create an instance of this object from a VB application (straight CreateObject call), the call seems to get stuck and never returns.
I'm assuming that the CWindowImpl message handler is conflicting with the default service one (so the messages to create the COM object are being ignored).
Is there a good sample anywhere that demonstrates how to have a service receive messages to a hidden window, whilst still being able to create instances of COM objects.
Michael
|
|
|
|
|
Hi Michael, (I am just throwing ideas here kind to see where's the problem)
1. Do you have a message loop in your service application? because your main thread needs a message loop to process message.
2. Your service is also the server, am I right? so if it fail with VB, try with C++ codes and check the reason why it fails.
3. You said that the hidden window messages are processed in a worker thread, I am not sure that you really need another thread (see 1)
Take care
ÿVOTD:5 "For to which of the angels did God ever say, "You are my Son; today I have become your Father"? Or again, "I will be his Father, and he will be my Son"? 6 And again, when God brings his firstborn into the world, he says, "Let all God's angels worship him." - Heb 1:5-6
|
|
|
|
|
why we are specifying this macro
|
|
|
|
|
This is an alias __declspec(novtable) , which instructs the compiler not to generate the corresponding vtable for a given class (which is safe as long as the class can not be instantiated, which happens e.g. with abstrat classes). Unless you're writing highly optimized code, there's no much reason to use it.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Anyone have recommendations for recent STL reference books for an otherwise very experienced C++ programmer.
|
|
|
|
|
Have you looked at Scott Meyers Effective STL. It is very similar to his Effective C++ books.
It is not quite a reference book, but there are many good tips on how to use STL effectively and properly once you become familiar with the mechanics of the generic programming templates.
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!
|
|
|
|
|
|
'The C++ Standard Library' by Nicolai Josuttis - v. good IMO.
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Generic Programming and the STL is good, it's basically an extension of the SGI docs. You should go to sgi.com/tech/stl first to see if their online docs are enough for you. I also second that you MUST own 'Effective STL' from Scott Meyers.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Joe Woodbury wrote:
Anyone have recommendations for recent STL reference books for an otherwise very experienced C++ programmer.
The book Effective STL by Scott Meyers is excellent, IMO. It was my first STL book ever; between it and the STL docs from SGI , I think I've been in good shape.
By the way, I liked your answer to the poster who asked about marketing software!
|
|
|
|
|
Thanks.
Meyers other books are great and this one apparently follows suit, so I'll get it.
|
|
|
|
|
I'm trying to implement owner-drawn menus in wtl 7.0. Unfortunately, I cannot determine the standard size of menu items.
My first attempt was
pms->itemHeight = ::GetSystemMetrics(SM_CYICON);
which didn't work. Next I tried
CFont font((HFONT)GetStockObject(DEFAULT_GUI_FONT));<br />
LOGFONT lf;<br />
font.GetLogFont(&lf);<br />
pms->itemHeigt = lf.lfHeight + 8;
which is what wtl source code led me to beleive. Unfortunately, lf.lfHeight + 8 does not help and the actual value seems to be lf.lfHeight + 10 . Does anyone know the correct way of doing this? Help would be much appreciated.
TemplMetaProg
|
|
|
|
|
Have you tried handling the WM_MEASUREITEM message? This message is sent when your menu is created and it will tell you how large your menu item is.
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!
|
|
|
|
|
that's EXACTLY what I'm trying to do...
I've tried calling parent's OnMeasureItem and then leaving itemHeight alone, but that doesn't help
nous sommes les maitres
nous sommes les esclaves
nous sommes partout
nous sommes nul part
nous maitrisons les lettres noires
|
|
|
|
|
Hi,
I'm kinda new to ATL and as such I'm after a little guidance
Say i want to be able to get Cheeseburger objects from Maccas. ie. A client would have to create a Maccas and then ask it for a Cheeseburger.
I can create the Maccas class using the ATL create object wizard, but i am unsure how i should create the stub code for the Cheeseburger object. Do i use the object wizard again? Would this not unnecessarily create a CoClass for the object and make it seperately instantiable (you don't have to get Cheeseburgers from Maccas anymore). How else do i do it?
In case it is important its desireable to support c++ and VB automation clients (scripted from office macros).
Thanks a bunch!
Alex
|
|
|
|
|
What I usually do is let ATL create it through the class wizard, then remove the stuff that I do not need.
So as you said, you do not want to create it using the CoClass object. Therefore remove the derivation from CComCoClass in your Cheesburger class. You will also need to go to the main cpp file of your project where the DLL entry point is located and remove the Cheeseburger entry from the
BEGIN_OBJECT_MAP map. This map tells the DLL which objects can be instantiated through CoCreateInstance.
That is all that you will need to do in order to prevent the object from being instantiated outside of your DLL. Then when you want to instantiate your class from the Maccas object, you will not be able to use new Cheeseburger because your class is still an abstract base class. You will actually need to do something like this:
<br />
CCheeseburger *pCheeseBurger = CComObject<CCheeseburger><br />
Good Luck
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!
|
|
|
|
|
Thank you, thank you, thank you!
|
|
|
|
|
I have posted a question associated with the article announcing the 2.24 release of the grid. I thought I would include this link for any ATL wizards who may wish to consider the problem.
thanks
|
|
|
|