|
Hello,
I added the Get/Set property in activeX cotrol which contain the "Invalidate()". While i use these properties in an application, the exe get terminate by saying unreferenced handle m_hwnd.
What else i have to do.
Please help me.
gajesh mangal
Pune(India)
|
|
|
|
|
I'm trying to make my own activex on the same model as the Instant Messenging activex provided by Microsoft: Name.NameCtrl.1
In such a model, a javascript function is passed to the activex:
...
IMNControlObj = new ActiveXObject("Name.NameCtrl.1");
...
IMNControlObj.OnStatusChange = IMNOnStatusChange;
...
And at the activex side (in C#), I have this:
public object OnStatusChange
{
set
{
// Couln't find any way to cast the 'value'
}
}
I've been looking for a solution for a long time.
I would appreciate if you have a solution or even a clue to help me.
Thanks.
|
|
|
|
|
Hello Everybody,
I have created one ActiveX DLL for printing Web page for my ASP Application. When I run the application i am getting Error like (0x800A01E2 Printer error) please help me in brief because i am new in ActiveX DLL Creation...
Thanks
N.Rajakumar B.E.,
Application Developer,
|
|
|
|
|
Iam struct with the problem of passing events from activex control property page to the control. My custom property page contains flexi grid where i define properties.
My problem is to pass events from grid on property page to control.
Can anyone help me on this problem....or any clue or example to find the solution.
Regards,
ashwin
|
|
|
|
|
hello,
I am using a OCX control in a dialog based application. While using the "all" tab in property page, the color dialog is displayed for a property.
But when i select the color from the color dialog, the selected color is not reflected.
What should i do to implement the OLE_COLOR property properly.
Thank You
Gajesh Mangal
Pune(India)
|
|
|
|
|
Dear friends,
Few days ago i developed an ActiveX control using MFC. The control was intened to be used by MFC dialog based clients. It is a windowless control. I preferred ActiveX control over simple COM dll, because it is easy to deal with the control events in MFC dialog based application. Just drop the control on the dialog, add a member variable, right click on it and handle events. So easy.
Now i want to use the functionality of this control in an application with no User Interface (i.e windows service). Is it possible to use the functionality exposed by ActiveX control in an application which provides no GUI container. If yes, then how ???
Ahsan
|
|
|
|
|
What you're really using, when you let ClassWizard do all that magic, is something called "connection points".
It's a way for the server to communicate asynchronously with the client about changes in the server, e.g. incoming data or user input.
You already have the server, but you need to implement a connection point sink. The sink is a COM interface defined by the server that the client implements and hands over a pointer to the server by a call to IConnectionPoint::Advise().
It's usually easier to have an example to look at so go and have a look at it here.[^]
Tip of the day, free of charge
Don't forget to marshal the sink interface in your server if you plan to fire events from different threads than the one that created the server.
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
I have created active X controls to capture images from various devices such as
fingerprint scanners. The final solution must now be deployed on a web solution.
Sure we all know about ActiveX controls and web pages, but put that aside,
How do I retrieve the information (blob) from the active X control and make it
part of the POST when the user presses Submit. ?
Some thoughts I have on this,
Save the blob temporary on the clients hard disk, and upload it via a
"file post" message, which is easy, but not ideal.
Start an independant "Thread" solution to ftp the file to the server.
Ideally it should form part of the post, but I am not sure how to impliment these
in the COM c++ code ?
Help appreciated
|
|
|
|
|
Hi guys,
I am new to COM. Any suggestions on how I should proceed.:->
I need tips on how to write my first simple hello world program using COM.
Thanks
Owner Drawn
--Nothing special
|
|
|
|
|
Hi,
1. There are a lot of resources here, in The Code Project. Use them.
2. If you have the posibility of buying books or taking them from anywhere, I recommend you Essential COM, from Don Box. The first chapter is the best introduction to COM I've ever read. There are a lot of books. Search in Amazon and just read the reviews.
In my case I've found some 2'nd hand copies of
Essential COM,
Inside Distributed COM (Gut Eddon, Henry Eddon) and
Developer's Workshop to COM and ATL 3.0.
3. Use the forums. This one and ...
microsoft.public.vc.atl
microsoft.public.win32.programmer.ole
4. be patient...
-- modified at 12:35 Friday 11th November, 2005
3 and a half. Here you can find some links of interest:
http://www.sellsbrothers.com/links/#unmanlinks[^]
|
|
|
|
|
Owner drawn wrote: need tips on how to write my first simple hello world program using COM.
Perhaps more information on the nuts and bolts of how one actually *writes* this software may be helpful.. I have a step-by-step DCOM tutorial, where I build a simple server which says "Hello, world!" back to the client, may help put some of this in practical perspective...
The tutorials are written as a series of separate articles, called Steps, which cover the major breakpoints in the development of the system.
Step 1 of the tutorial for VC 6 is at
http://www.codeproject.com/com/HelloTutorial1.asp[^]
And Step 1 of the turtorial for Visual C++.NET 2003 is at
http://www.codeproject.com/useritems/HelloTutorial1NET.asp[^]
I tried to write the tutorials in Microsoft-ese, so you can follow along as if you were reading the Scribble tutorial. The VS.NET version is still a work in progress; that's why it's still in "Unedited User Constributions."
Not all the Steps have been written for the VS.NET version yet. But I am working on it!
Stay tuned!
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|
|
Hi,
Please help on the following issue.
How can I creat a BSTR using a char array, containing NULLS . I am failing to do it this ways:-
void CEquipMain::varTest(){
char str[] = {'L',0x00,0x00,0x01,0x00,'S',0x08,0x00};
BSTR bstrng = ::SysAllocStringByteLen(str,sizeof(str));
char* data = _com_util::ConvertBSTRToString(bstrng);
printf("4th element in str:%d ",str[3]);
printf("4th element in :%d ",data[3]);
SysFreeString(bstrng);// deallocates the memory and kills the object
bstrng = NULL; // varaible is initialised to null
}
the output i get is :
4th element in str:1
4th element in str:8
If we dont count the Nulls, the 4th character is 0x08.
This proves that the BSTR is not properly created and it skipped the NULLs while creating the BSTR!!!
amit
|
|
|
|
|
Hello Amit,
I think the problem is you use the lowlevel function SysAllocStringByteLen. This function places an Ansi String into an Unicode BSTR without conversion.
Later ConvertBSTRToString assumes that bstrng contains an unicode string and converts it to ansi. This ist the reaseon that leading zeros are missing.
If you try following
wchar_t str[] = {L'L',0x00,0x00,0x01,0x00,L'S',0x08,0x00};
BSTR bstrng = ::SysAllocStringLen(str,sizeof(str));
it should behave as expected
Welf Wiest
|
|
|
|
|
Hi Welf,
So I understand that using ::SysAllocStringLen() and a Unicode (or wide char) string is better.
But does this mean that there no solution for the same if using ANSI string and ::SysAllocStringByteLen?????
Actually, I recieve the ANSI strings to be converted in BSTR.
I work-around this issue by first converting the ANSI to Unicode by function MultiByteToWideChar() and then using ::SysAllocStringLen().
Does this sounds efficient??
Thanks for your responce
Amit
|
|
|
|
|
Hi Amit,
yes this sounds efficient.
For example I use this code sequence to convert an ANSI STL String to a BSTR in my STL to automation layer
_my_type& operator=(const std::string &Src)
{
DWORD dwLen = Src.length();
CComBSTR bstr(dwLen);
if(dwLen > 0)
if(!MultiByteToWideChar(CP_ACP, 0, Src.c_str(), dwLen, bstr, dwLen))
ThrowFromHRESULT(HRESULT_FROM_WIN32(GetLastError()));
m_vntValue = bstr;
_assign();
return *this;
}
//Simplified Version without STL / ATL
HRESULT toBSTR(const char *szString, BSTR *bstrResult)
{
HRESULT hr = S_OK;
BSTR bstr = 0;
if(bstrResult == 0)
return E_INVALIDARG;
DWORD dwLen = lstrlenA(szString);
bstr = SysAllocStringLen(0, dwLen);
if(bstr == 0)
hr = E_OUTOFMEMORY;
else if(dwLen > 0)
{
if(!MultiByteToWideChar(CP_ACP, 0, szString, dwLen, bstr, dwLen))
hr = HRESULT_FROM_WIN32(GetLastError());
}
if(SUCCEEDED(hr))
*bstrResult = bstr;
else if(bstr != 0)
SysFreeString(bstr);
return hr;
}
This Codes allocates the memory first and then initializes the string by MultiBytToWideChar
Welf
|
|
|
|
|
I have a variant data in VC++ DLL. I want to pass it to Java application through JNI's jstring. How to do it without loosing the embedded Nulls in the variant data.
Thanks in Adv.
Amit
|
|
|
|
|
I have DCOM- server. It good work on the one network (one domain). Need run this server from a different network (other domain) (client in one network, server - in other ).Between this networks - wirewall, and no trust. Have access from firewall between client and server (have ping), but, when client call server, i have error: RPC Server unavailable!
Is It possible: run DCOM server from other domain (without trust between networks) ?
If it's possible, ask me how?
HELP, please...
Thank's...
P.S. Sorry for my bad english...
|
|
|
|
|
Can anyone pls tell how to configure "Network Logon Security" while creating a profile using MAPI.
I need to create the profile without showing the profile creation dialog box (exchange server dialog box).
i used the following code to create a profile.
i could successfully create a profile, but the "Logon Network Security" option is set to "NT Password Authetication" by default.
i want to change it to "None" programmatically using MAPI.
how do i do that ??
please help.
Thank You.
// Initialize MAPI
if (FAILED(hRes = MAPIInitialize(NULL))) {
AfxMessageBox("Could not Initialize MAPI");
return FALSE;
}
// Get an IProfAdmin interface
if (FAILED(hRes = MAPIAdminProfiles(0,&lpProfAdmin))) {
AfxMessageBox("Could not Create Profile. Contact Admin");
return FALSE;
}
// Create a new profile
if (FAILED(hRes = lpProfAdmin->CreateProfile(szProfile,szPassword,NULL,
MAPI_DEFAULT_SERVICES))) {
AfxMessageBox("Could not Create Profile. Contact Admin");
}
Deep George Zachariah
|
|
|
|
|
Hi all,
Can someone please guide me on how can I call a C# COM Object from VC++ 6.0?
Best Regards,
E.A.
|
|
|
|
|
If the lib files were built with the later compilers you will have link problems building with VC6. The latest version of Platform SDK has some libs that will not compile with VC6.
|
|
|
|
|
hi every body
i need help
i want to know the steps to build my own chat room .
iam beginer . its my dream to make chat room
engriri2006
|
|
|
|
|
You may be able to find a canned package in PHP or other web code, but I don't it would be done in COM.
|
|
|
|
|
Perhaps more information on the nuts and bolts of how one actually *writes* this software may be helpful.. I have a step-by-step DCOM tutorial, where I build a simple server which says "Hello, world!" back to the client, may help put some of this in practical perspective...
The tutorials are written as a series of separate articles, called Steps, which cover the major breakpoints in the development of the system.
Step 1 of the tutorial for VC 6 is at
http://www.codeproject.com/com/HelloTutorial1.asp[^]
And Step 1 of the turtorial for Visual C++.NET 2003 is at
http://www.codeproject.com/useritems/HelloTutorial1NET.asp[^]
I tried to write the tutorials in Microsoft-ese, so you can follow along as if you were reading the Scribble tutorial. The VS.NET version is still a work in progress; that's why it's still in "Unedited User Constributions."
Not all the Steps have been written for the VS.NET version yet. But I am working on it!
Stay tuned!
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|
|
Hi everyoone,
I made a function that bring any window of any application to top.
But I have a issue with the Microsoft Word application.
When I have many Word application running and I want one of them (specific) on the top of the Z-order, it's allways the same instance of word that come on top. I looked their window handle and there all different.
Example : (doc1) (doc2) (doc3)
If I want doc3, it's doc1 that will prompted on top.
A Work around is that if a press the alt key after the issue operation, the right instance of word come on top of the Z-Order.
Some of functions that I tryed to do that operation:
::SetActiveWindow( oSelectedApp.GetWindow() );<br />
::SetForegroundWindow( oSelectedApp.GetWindow() );<br />
::ShowWindow( oSelectedApp.GetWindow(), SW_SHOW );<br />
::SetWindowPos( oSelectedApp.GetWindow(), HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW );
I seen this problem only for Microsoft Word application.
Sébastien Nadeau
Software Developper
|
|
|
|
|
Microsoft as the property that many application is launch by the same process.
Only one process "WINWORD.exe" but many instance of word in the Task Manager application list.
|
|
|
|
|