|
|
hi to all , i have 2 enum on my IDL file :
interface myInterFace
{
typedef enum RPTR_RETRACTBIN_STATUS
{
RPTR_RETRACTBIN_OK,
RPTR_RETRACTBIN_FULL,
RPTR_RETRACTBIN_HIGH,
RPTR_RETRACTBIN_NOT_SUPPORTED,
RPTR_RETRACTBIN_UNKNOWN
}RPtrRetractBinStatus;
...
HRESULT SyncRetract([out,retval] RPtrRetractBinStatus * status);
}
library myLIB
{
typedef enum RPTR_RETRACT_TRESHOLD
{
RPTR_THRESHOLD_RETRACTBIN_FULL,
RPTR_RETRACTBIN_HIGH
}RPtrRetractThreshold;
...
dispinterface _IXFSReceiptPrinterEvents
{
properties :
methods:
HRESULT StackOK(RPtrRetractThreshold reason);
};
...
}
after compile i have this error ::>> redefinition : RPTR_RETRACTBIN_HIGH
what is its solution ?(NOTE : i can not rename any enum members)
modified on Thursday, July 10, 2008 1:35 PM
|
|
|
|
|
The enum keyword specifies an enumerated type.
An enumerated type is a user-defined type consisting of a set of named constants called enumerators. By default, the first enumerator has a value of 0, and each successive enumerator is one larger than the value of the previous one, unless you explicitly specify a value for a particular enumerator. Enumerators needn’t have unique values. The name of each enumerator is treated as a constant and must be unique within the scope where the enum is defined. An enumerator can be promoted to an integer value. However, converting an integer to an enumerator requires an explicit cast, and the results are not defined.
(c) MSDN
With best wishes,
Vita
|
|
|
|
|
Hi guys, I have some serious problems with com+ and the ibm mq series.
I have a windows service with a com+ defined class (inherits ServicedComponent,
has [Transaction(TransactionOption.RequiresNew)] and [AutoComplete(true)] on the
method.
The problem is that the mq series part never rolls back in case of any errors,
the other transactions works perfectly fine.
When it comes to the mq connection, I have set up the enviroment to use server-
bindings (a requirement for using transactions)
MQEnvironment.properties[MQC.TRANSPORT_PROPERTY] = MQC.TRANSPORT_MQSERIES_BINDINGS;
and the connection / send looks like this (stripped):
queueManager = new MQQueueManager(queueManagerName, channel, host);
queueManager.Connect();
...
sendOptions = new MQPutMessageOptions();
sendOptions.Options += MQC.MQRO_NEW_MSG_ID + MQC.MQRO_COPY_MSG_ID_TO_CORREL_ID;
sendOptions.Options += MQC.MQGMO_SYNCPOINT;
...
queue = queueManager.AccessQueue(queueName, MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING);
queue.Put(msg, sendOptions);
queue.Close();
Do I have to do anything in perticular in the transaction-based method for this to work?
Scaled down, it looks lite this:
[AutoComplete(true)]
function void DoWork()
{
try
{
send_message_on_mqqueue();
do_some_db_work();
ContextUtil.SetComplete();
}
catch (Exception)
{
ContextUtil.SetAbort();
}
}
Any help, thoughts or suggestions are appreciated!
|
|
|
|
|
Hi All,
I am building a com dll using vs2005. I have created two events. I have created a client application in VB and built an exe. When I run my application in debug mode, I get an exception in fire events dispatch method, which states "unhandled exception at 0x661068 second.exe: 0xc00000005. Access violation writing location 0x0000050."
In the above error the "second.exe" is the exe name of my vb application.
But when I run the application in vb I get the events is getting fired, some time the application gets crashed. When I put a break point in the fire_event method the application crashes for sure when an event gets fired for the first time.
can any one help in this. And I have another query, does the vc++ through an error like the one I have stated above when we debug the application that contains a breakpoint?
Kindly clarify!
Regards,
LG.
lgatcodeproject
|
|
|
|
|
Maybe the interop file is corrupt so try
1) cleaning the entire solution and running again
2) Deleting the COM dlls references and objects from your vb proyect and putting them again.
JO
|
|
|
|
|
My application fails with "This application has failed to start because the application configuration is incorrect. ..." on other computers.
I know that Microsoft Visual C++ 2008 Redistributable Package or Creating setup.exe helps, but I need another solution.
I want my program to work without installers and packages. What should I change in project properties?
PS:I am working in Visual Studio 2008.
|
|
|
|
|
If you are working with COM you should check if the your custom COM Components dlls are being registered properly.
You could make two scripts to do this, for exmple
Reg.BAT
regsvr32 ProcessLibrary.dll
regsvr32 ProcessLibraryPS.dll
UnReg.Bat
regsvr32 /u ProcessLibrary.dll
regsvr32 /u ProcessLibraryPS.dll
JO
|
|
|
|
|
I use "Standard windows libraries" with "common language runtime support"
As I understand MSDN, I should register msvcm90.dll, msvcp90.dll, msvcr90.dll on computer to run my application. Am I right?
|
|
|
|
|
No,
The dlls you should register in order to use them are the ones of you COM Components (i assumed you were developing COM somponent for the Forum name ).
You could Also check for missing dlls in you installation directory with the dependency walker, this little program checks yor .exe for missing dependencies so you could copy to the instalation dir the files missing (ie: msvcm90.dll, msvcp90.dll, msvcr90.dll )
You could download dependencywalker from:
http://www.dependencywalker.com
JO
|
|
|
|
|
After using dependencywalker I understood that my program requires msvcm90.dll, msvcp90.dll, msvcr90.dll.
I copied them into directory with my .exe file, but it didn't helps. Maybe I should copy them to some system folder&
|
|
|
|
|
|
Just for clarification, this isn't a COM error. It is caused by an Fancy MS feature called Windows Shared Side by side Assemblies (or any other weird name, so apologize). See http://msdn.microsoft.com/en-us/library/aa375996(VS.85).aspx[^]
Never wondered about the C:\WINDOWS\WinSxS directory?
The worst thing you can do is copying the 9.0 dlls to your exe path, or simply registering them in your system directories since this can cause third party applications to fail!!!
The MS way would be redistributing the dlls with their own created merge modules located somewhere in the Studio folder. (I'm too lazy to look up the correct location, if you can't find them PM me ).
So long,
Stefan
|
|
|
|
|
C:\Program Files\Common Files\Merge Modules
Scot Brennecke
Software Developer
VC++ MVP
|
|
|
|
|
Hello Friends,
I am using Windows Vista and I am builing an c++ ATL DLL in Visual C++ 6.0, which is an addin DLL for Windows Mail. (Outlook Express)
When I run my Windows Mail, Vista's DEP (Data Execution Prevention) feature blocks it, and prompts that it blocked for security purpose as some other program tried to use windows mail data.
But I have to hook into Windows Mail as have to put an addin to customize its GUI.
I tried to turn DEP off for Windows Mail, but it didnt allow me (even in Full Admin Account).
Also I turned DEP off for my exe (which loads my addin DLL, which further hooks into Windows Mail), but despite that Windows Mail is blocked.
Also, when I build the project in Visual Studio 2005, it runs very well. (And I have not made any change in the project settings or code)
It seems, VC 6 uses older compilers and VS 2005 uses latest ones so are compatible with Vista!
But I have to use VC 6 only as it's my project's requirement!
Please Help!
Thanks a lot !!
dolly,
N,IN
|
|
|
|
|
The ATL in VC++ 7.1 and earlier makes use of thunk code that requires executing code from a data block. The DEP feature prevents that. Here is a KB article I wrote on the subject:
Applications Using Older ATL Components May Experience Conflicts With DEP:
http://support.microsoft.com/kb/948468
Scot Brennecke
Software Developer
VC++ MVP
|
|
|
|
|
I am trying to export function from raw COM DLL and for the purpose i am using .def file.
I am using LoadLibrary to load the DLL in the client process area.
HINSTANCE hComponent = ::LoadLibrary("Cmpnt1.dll") ;
if (hComponent == NULL)
{
//Error: Load library fail.
return NULL ;
}
The Dll is loading properly.
After that i am calling GetProcAddress to get the address from the DLL.
CREATEFUNCPTR CreateInstance;
CreateInstance = (CREATEFUNCPTR)::GetProcAddress(hComponent,"CreateInstance") ;
if (CreateInstance == NULL)
{
// Print error
return NULL ;
}
return CreateInstance() ;
This call fails with return code 127.which means the function was not found.
any suggestion
~sandy
Thanks in Advance.
|
|
|
|
|
There seems to be some problem in the way you export your functions from the component. the compiler mangles the name and this is not getting resolved.
Check this out:
1> Do you export the function(s) properly
2> extern "C" is in use
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
yes, i am using extern "C" and for exporting function i am using .def file and as per my knowledge i am doing it properly. otherwise i think loadLibrary would have also failed.
|
|
|
|
|
Just create a new ATL DLL project. It will put a few export functions there. Search for one of those functions to see how your code is different.
I've just extended my COM DLL using such by-example technique, it worked fine.
|
|
|
|
|
Hello everybody,
I hope someone can help me...
My .net code goes like this...
public class ProxyFacade : BaseProxyFacade
{
ProxyConfiguration _configuration = new ProxyConfiguration();
public ProxyFacade(Uri Uri)
{
_configuration.Url = Uri;
}
public Student IncreaseAge(Student StudObj)
{
StudentServiceClient client;
base.ProxyConfiguration = _configuration;
base.PreProceedHandler();
client = new StudentServiceClient(base.BaseProxy, base.BaseProxy.EndPointAddress);
client.Open();
return client.IncreaseAge(StudObj);
}
}
My Issue: I have registered this dll as COM component.
When I try to instantiate this ProxyFacade from VB6, I am not able to give the object reference with New Keyword?
Do I have to set anything in the .net side? What is the correct way to instantiate this .net object registered as COM?
My VB6 code:
Private Sub cmd_CallCOM_Click()
Dim objStud As New ProxyLibrary.Student
Dim a As Integer
objStud.Age = 11
objStud.Name = "Johnie"
objStud.IsOutStanding = False
Dim objFacade As ProxyLibrary.StudentServiceClient
Dim b As ProxyFacade
'a = objFacade.IncreaseAge()
'Set objFacade = GetObject("http://localhost:3507/StudentException/Student%20Service.svc/rest")
lbl_Age.Caption = objFacade.IncreaseAge(objStud).Age
End Sub
When i tried with GetObject, again error...
I think i am taking a wrong way to instantiate this object which has parameterized constructor...
Any help plssssssssss
Tnx in advance,
Saran
|
|
|
|
|
For a while my code has been running fine on a server, but for the last week it's been failing consistently. I started debugging and found out that it's failing when I call CoCreateInstance. The error code returned is:
0x8007000E
When I looked it up, the corresponding message is:
"Not enough storage is available to complete this operation."
What does this really mean? I looked at the server and there seems to be plenty of free memory (RAM) for applications. I'm fairly new to COM, but from what I understand, this method is called to create an object using a Class ID or Program ID (from MSDN), I've tried this app on another server and it seems to work. I'm fairly new to COM, so any information you can share would be helpful.
|
|
|
|
|
Hmm, never came back to this, there were so many things running on this particular box, it was resource related.
|
|
|
|
|
Hi All,
I've been planning for some time to do a project with COM for the community of software developers.
The project, in essense, is to generalize access to all information on the PC in a simple way, something like what WMI does, only better (read simpler).
I wonder, however, if i'm not too behind doing this (a few years), and whether a COM project, if it is good, can still be applaused by .NET developers?
Any opinions here are welcome!
Cheers!
|
|
|
|
|
I know this is a bit early to wonder if this post would ever be answered, but i published information about the idea here: http://www.codeproject.com/script/Forums/View.aspx?fid=1641[^]
It's titled Researching Opinions: Professional System Library
I think this might be of interest to all COM developers.
Cheers!
|
|
|
|