|
I have seen the COM from scratch...but still not getting.........
I just want to create simple COM component.........
shailesh
|
|
|
|
|
Unfortunately it is difficult for a COM component to be 'simple', however, this book [^]. gives a good explanation of a basic COM component.
Anyway, you can easily create a COM component project using the MFC or the ATL wizard.
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.
|
|
|
|
|
Have you read my Intro to COM[^] articles? Part 2 shows how to write a COM server and shows how to call it.
|
|
|
|
|
Can any one help me i am new commer to com . can we use com controls
in .NET
vimal
|
|
|
|
|
Yes, have a look at [^].
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.
|
|
|
|
|
As I am new to COM I still unable to get the Life cycle of COM program...or flow of program...
so I want the step by step program or step by step code with descripton to generate new COM component...
shailesh
|
|
|
|
|
There's the Jeff Glatt's very good article series here at CP, follow the link to the first article.
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.
|
|
|
|
|
Hi group,
I have written a COM Addin for Excel so I did add few lines to add a custom menu in Excel. It worked fine but as I was playing with the code I passed a parameter which has made the menus permenant instead of temporary. Now, when you run the Excel the menu comes. How can I remove it or reset the Excel menu bar?
Your help is appreciated greatly.
Regards,
Amit
|
|
|
|
|
Hi group again,
It is solved by using the "Detect and Repait" under Help menu.
Amit
|
|
|
|
|
Hi,
I'm fairly new to COM, despite being late in the game, so to speak.
I've got a COM object that upon unregistering, is removing keys from another COM object.
We've tracked the problem to an offending 'import'.
COM object A.idl imports B.idl, which in turn imports C.idl.
On registration / unregistration, COM object A registers / unregisters (the guids for) COM object C.
Unfortunately, the import calls are needed as both A and B use types defined in C.
Trying to include the header files for B and C are presenting problems due to redefinitions of types in winnt.h.
If I remove the offending import call in A.idl the problem is resolved, but I must remove one of the methods from the interface in order to build the object.
I didn't design this software, but I am faced with having to fix it.
cheekymuppet
|
|
|
|
|
Hi all
I need to OCR a picture box image, the image of the picture box is created by setting bitmap pixels:
Bitmap ^ bmpPenImage = gcnew Bitmap(siPenImageWidth, siPenImageHeight);
pictureBox1->Image::set(bmpPenImage);
bmpPenImage->Save(L"savedImage.bmp",System::Drawing::Imaging::ImageFormat::MemoryBmp);
MODI::Document ^ aDocument = gcnew MODI::Document();
aDocument->Create(L"savedImage.bmp");
aDocument->OCR(MODI::MiLANGUAGES::miLANG_ENGLISH, true, true);
MODI::Image ^ anImage = (MODI::Image ^)aDocument->Images[0];
MODI::Layout ^ aLayout = anImage->Layout;
MODI::Word ^ aWord = (MODI::Word ^)aLayout->Words[0];
label1->Text = aWord->Text;
aDocument->Close(false);
As you can see i'm using a lame approach by saving the image and then reading it again in the lack of something else But this approach gives me the following runtime error:
COMException: OCR Running error
I would appreciate it if someone could help me with maybe a different approach? I can't find much info about document imaging 12. in Visual C++ 2005.
Thanks alot
|
|
|
|
|
Found a solution myself after much experimenting...
setting the image to a pictureBox in some way bounds that image file so that it cannot be used by OCR... if you move the statement "pictureBox1->Image::set(bmpPenImage); to the end, that is after aDocument->Close(false); it works.
OCR also appears to be sensitive to the image size, i'm still experimenting but it seems to like larger scaled images, you sometimes get the same "OCR running error" setting pixels to blue, this is all wierd but if someone can still clear this issue i'll be thankful.
|
|
|
|
|
If I create an instance of an Out of Process Server, what part of Windows actually calls CreateProcess() to launch the executable?
Is it one of the services, or something deeper?
|
|
|
|
|
Is the COM Service Control Manager see [^] for details and references.
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.
|
|
|
|
|
Good day
I have a got a big problem on my hands and it has been bugging me for a week now. I have got a .Net assembly that communicates to an SQL Compact Edition DB file (.sdf) via a web service. Inside this assembly is a thread that, on regular intervals, talks to the DB via the web service. This works well if the assembly is consumed by a .Net application.
My problem is that I have a Delphi application and I was to use the .Net assembly which is exposed as a COM object. The assembly does get registered and everything looks right. I have established that the thread in the now COM object does get triggered and it does what it's supposed to do. What I have noticed though is that i get file violation errors on the .sdf file. This I find disturbing because it is only the processes hosting the web service that is communicating with the DB file, and this only happens when the using Delphi application to use the COM object, it does not happened with .Net applications.
I have also traced the error to the method that is being called by the COM thread. So i would like anyone who has had something to help me. I have run out of ideas as to how to debug this problem. Please point me to the right direction.
Thanks in advance
Kulile --- RSA
|
|
|
|
|
Hi all,
I've created a simple COM component using ATL and itz registered also.When i tried to create the component using CoCreateInstance i get a HRESULT which tells that
<b>"0x80040111 ClassFactory cannot supply requested class ".</b>
There is only one instance of the component present in the registry and the CLSID,Interface ID everything i passed to the COCreateInstance are correct but still the problem is not over.
Any help would be greatly apppreciated.Thanks in advance.
Regards,
Rajeev
|
|
|
|
|
Try to load the component using OLEVIEW tool. Also try to post the CoCreateInstance code snippet.
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.
|
|
|
|
|
CLSID aclsid;
//interface to be created
IMIConverter *m_pToConverter = NULL;
aIUnknown = NULL;
HRESULT hr;
//this step also gets the correct class ID
hr = CLSIDFromProgID(L"MITFConverter.MIConverter",&aclsid);
// This HRESULT gives the problem
hr=CoCreateInstance(aclsid,NULL,CLSCTX_ALL,IID_IMIConverter,(void**)&m_pToConverter);
Thanks for your help
|
|
|
|
|
Have you made an attempt (to load the Component) with OLEVIEW?
The hr value you reported shouldn't happen since MSDN reports S_OK , REGDB_E_CLASSNOTREG or CLASS_E_NOAGGREGATION as possible return values.
You can also try to use CoGetClassObject and then call CreateInstance on the (hopefully) obtained class factory pointer to see what is happening.
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.
|
|
|
|
|
Hi,
When i tried to load the component using OLE view it displays an MK_E_INVALIDEXTENSION error.
I tried calling CoGetClassObject but the return is always the same (Class Factory cannot supply the requested class).I'm Totally lost
Is there Anything else that i can try??
Thanks for your help
|
|
|
|
|
as you can easily find here [^], CoGetClassObject cannot return such a hr value, hence I suggest to you to check well your code. can you post the hexadecimal value of the returned hr ?
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.
|
|
|
|
|
0x80040111..is the returned HRESULT s hexdecimal value...
|
|
|
|
|
It seems something went wrong during registration. I'm sorry I cannot help you with this.
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.
|
|
|
|
|
That alright..Anyhow thanks a lot for ur help
|
|
|
|
|
Hello all,
Can someone provide me interview questions on VC++, COM, ATL.
I need those desperatly.
Thanks...... .
|
|
|
|