|
rajeshgupta1253 wrote: clsids are same
Is it the name that's the same or the GUIDs(it can't be)?
ATL COM DLLs come with namespaces if you have the tlb file associated with them, namespaces does help avoid such cases.
Then there is a rename attribute that can be used with a tlb file while using #import .
From MSDN:
The rename attribute is used to work around name collision problems. If this attribute is specified, the compiler replaces all occurrences of OldName in a type library with the user-supplied NewName in the resulting header files.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
|
This is supposed to be a no-no....
If the two servers have the same class id, then it is the same server, by definition and by COM spec. It may be that the later server is an updated version, but it is still the same server.
If the supplier of the two servers claims that those are two different servers, they have broken some of the fundamental rules of COM and there are no guarantees for this to work when distributed even if you might get it to work on your machine.
The human readable ProgID may be updated with a new version from e.g. <Company>.<Server>.1 to <Company>.<Server>.2, then they also have to give the server a new class id.
If the supplier of the two servers confirms that this is the same server, then your project requirements are wrong or misinterpreted since this is not how the COM architecture works.
It may give a hint if you compare the ProgIDs.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I guess the coders had a sample project and had written some code but not changed the CLSIDs.
Greetings from Germany
|
|
|
|
|
Different CLSID for different modules is a primary role for COM. The CLSID should be changed if there is no compatibility in the interface!!!!
You better explain the creators of the dlls that the same CLSID are crappy.
I bet that they came from the same person who hasnt enough experience to deal with COM.
Greetings from Germany
|
|
|
|
|
Hi What is the correct way to avoid globals in accessing callbacks.
E.g.
A signal handler for ctrl-C or similar.
I have seen the boost:function and boost::bind used for user defined callbacks but I am yet it to see this being used for a standard C system library with callback.
E.g.
void sig(){};
int main()
{
signal(SIGINT,sig);
}
If sig was a member of a class is it possible to use boost::bind or otherwise so that when a signal interrupt is generated it is possible
to access the members of the class without the use of globals?
Regards,
flip
|
|
|
|
|
Hello Friends,
I have an <b>ATL project in Visual Studio 2005, but now I want it in Visual C++6.0.</b>
I have used one utility available on Code Project only i.e.
<b>prjconverter.exe</b>
it converted .sln to .dsw BUT on building the project,
I am having many error, mainly
<b>"C:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE\atlcom.h(2945) : error C2065: '_Module' : undeclared identifier"</b>
Because even in converted project,
class Coeapi_sampleModule : public <b>CAtlDllModuleT</b>< Coeapi_sampleModule >
{
public :
DECLARE_LIBID(LIBID_oeapi_sampleLib)
DECLARE_REGISTRY_APPID_RESOURCEID(IDR_OEAPI_SAMPLE, "{2FB8F87B-D079-497D-8948-F2F060162392}")
};
<b>Coeapi_sampleModule _AtlModule</b>;
<b>BUT</b>
what I want (generated by compiler if we build in vc 6) is
<b>CComModule _Module;</b>
and i read that CComModule is obsolete now, but I have to use it anyway because <b>I have to code & build the project in Visual C++ 6.0</b> only not in Visual Studio 2005.
Please Help.
Thanks well in Advance!
dolly,
N,IN
|
|
|
|
|
The simplest approach would be to create an ATL project in VC6 with the same name, and then use the wizards to add the same objects and methods. This will fill in the boilerplate code for you properly (which is probably causing most of your compiler errors).
Once you get this constructed, copy/paste the method implementations from your VS2005 project into the VC6 version.
|
|
|
|
|
Hi Guys,
I am trying to wrap a LIB file (content unknown, but header file is available) into a DLL, so as to be able to use it in a C# App.
I have created a C++ DLL (MFC-Shared) with the following code:
#pragma once
#ifndef __AFXWIN_H__ #error "include 'stdafx.h' before including this file for PCH"
#endif
#ifndef _DEFINED_myProg_H_
#define _DEFINED_myProg_H_
#if _MSC_VER > 1000
#pragma once
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif
#include "resource.h"
#include "origlib.h"
bool GetList(CString *List1, CString *List2, CString *List3, int &iCount);
#include "stdafx.h"
#include "origlib.h"
#include "myprog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
extern "C" __declspec(dllexport) bool GetList(CString *List1, CString *List2, CString *List3, int &iCount);
bool GetList(CString *List1, CString *List2, CString *List3, int &iCount);
{
return bVal;
}
This DLL compiles ok.
So, i tried to test it in a MFC Test Application:
void CDLLTestDlg::OnBnClickedSearchbutton()
{
CString *Arr1, *Arr2, *Arr3;
int iDev = 0;
GetList(Arr1, Arr2, Arr3, iDev);
}
However, here I get a linker error:
LNK2001: unresolved external symbol "bool __cdecl GetList (class ATL::CStringT<wchar_t,> blah...blah...,int &)" (?GetList@@YA_NPAV?$CStringT@_WV?$StrTraitMFC_DLL@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@00AAH@Z)
Could anyone please help me, where I am going wrong??
Thank u soooo much
|
|
|
|
|
You need to add extern "C" to the function prototype bool GetList(...) in your header file. The compiler is treating that as a C++ declaration, which means a C++ decorated name is being output to the linker. The extern "C" qualifier tells the compiler and linker to treat the function as having "C"-style linkage.
|
|
|
|
|
The linker says what you do wrong: interfacing ATL-Objects.
You need to have a plain interface with 'const WCHAR*' so there are no objects involved.
Greetings from Germany
|
|
|
|
|
Hi all,
I want to show Borderless About box on initially when i run my application.
I want this About box doesn't have any border,Close button or OK button.
I want it is automatically close after sometime (like 20 t0 30 sec) and then application run .
Please tell me how can do this.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Your requirements define a Splash Window [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
"_$h@nky_" wrote: I want to show Borderless About box on initially when i run my application.
I want this About box doesn't have any border,Close button or OK button.
I want it is automatically close after sometime (like 20 t0 30 sec) and then application run
In and around Mumbai, we call this a splash screen. Search CP for articles on splash screen.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Visual C++ MVP
|
|
|
|
|
Surprisingly enough, also in Roma splash screen is a popular name for the above.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
That's surprising and shocking at the same time.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Visual C++ MVP
|
|
|
|
|
Unjustified 1 vote here [^].
Super-hero intervention needed.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Balanced.
You must give the troll some coffee, may be.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: You must give the troll some coffee, may be.
Pizza & wine.
(though I prefer drinking beer while eating pizza).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
http://www.codeproject.com/KB/dialog/dialogspl.aspx[^]
Hi m taking help with this article,it is a dlg base application.
But my application is SDI type.
So please tell me this is not working for SDI type application.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi all..
I am reading one file and want to store same in temporary file..
but i am getting error..
Cannot move temp file.
Code i used is..
#include "stdafx.h"
#include "windows.h"
#define BUFSIZE 4096
int main()
{
HANDLE hFile;
HANDLE hTempFile;
DWORD dwBytesRead, dwBytesWritten, dwBufSize=BUFSIZE;
char szTempName[MAX_PATH];
char buffer[BUFSIZE];
char lpPathBuffer[BUFSIZE];
hFile = CreateFile("original.txt",
GENERIC_READ,
0,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
printf("Could not open file.");
return 0;
}
GetTempPath(dwBufSize,
lpPathBuffer);
GetTempFileName(lpPathBuffer,
"NEW",
0,
szTempName);
hTempFile = CreateFile((LPTSTR) szTempName,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL);
if (hTempFile == INVALID_HANDLE_VALUE)
{
printf("Could not create temporary file.");
return 0;
}
do
{
if (ReadFile(hFile, buffer, 4096,
&dwBytesRead, NULL))
{
CharUpperBuff(buffer, dwBytesRead);
WriteFile(hTempFile, buffer, dwBytesRead,
&dwBytesWritten, NULL);
}
}
while (dwBytesRead == BUFSIZE);
CloseHandle(hFile);
CloseHandle(hTempFile);
if (!MoveFileEx(szTempName,
"allcaps.txt",
MOVEFILE_REPLACE_EXISTING))
{
printf("Could not move temp file.");
return 0;
}
return 0;
}
thank you
manju
modified on Thursday, July 3, 2008 8:09 AM
|
|
|
|
|
Please use the pre tag, as the posting guidelines ask.
My eyes are hurting just looking at that lump of non-indented code.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Your allcaps.txt is readonly?
Well, add @err,hr to watch window, so that you'll get more detailed error description.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
I want a edit box to get transparent upto a level on mouse leave or when lost of focus from edit box.
The edit box will get fully visible on Setfocus or mousehover.
-@SuDhIrKuMaR@-
|
|
|
|
|
You'd have to experiment, but I think you can handle the WM_CTLCOLOREDIT message and set a brush for the background of the edit box.
You can detect whether the edit box has focus or not, and set different backgrounds.
If one brush looks a lot like your dialog background, then transparency! Or perhaps you can set a NULL brush?
I hope that gives you something to work with.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|