|
Advice taken, book bought, thanks (only £6.99 from Amazon!)
"The folly of man is that he dreams of what he can never achieve rather than dream of what he can."
|
|
|
|
|
Nice Choices...COM Primer Plus is a good one
~CodeTheDreams~
|
|
|
|
|
I am attempting to develop an ActiveX control subclassed from the MFC Listbox.
Following the MSDN tutorial, I set everything up through the Control Wizard, including setting LISTBOX as the subclassed windows control. The problem is, the tutorials (I have read several) all say "If you want your subclassed control to keep the same appearance as the corresponding Windows control, the OnDraw member function for the control should contain only a call to the DoSuperclassPaint member function, as in the following example:
void CSampleCtrl::OnDraw( CDC* pdc, const CRect& rcBounds,
const CRect& rcInvalid )
{
DoSuperclassPaint( pdc, rcBounds );
}
"
Which is what the Control Wizard automatically does and which is how I left it. I was thinking that if I just leave it like so, when I add it to a new project, it will draw me a standard-looking listbox. Instead, I get a plain white box. I also tried calling AddString in my project and was informed by the compiler that the method does not exist.
So far I see no evidence of my ActiveX control being subclassed form LISTBOX (I have the following as well provided by class wizard:
BOOL CSampleCtrl::PreCreateWindow( CREATESTRUCT& cs )
{
cs.lpszClass = _T("BUTTON");
return COleControl::PreCreateWindow(cs);
}
BOOL CSampleCtrl::IsSubclassedControl( )
{
return TRUE;
}
)
Why am I just getting a white box?? Are there some message handlers I need to address first?? As for the AddString not working, I'm still a little rusty on subclassing... do I have to add methods for all listbox methods I want to use in my control and just call CListbox::Addstring(blah, blah, blah) in order to use the Listbox Functionality???
I have read a lot of articles and tutorials on subclassing and activex controls and mfc controls and there seems to be something that I don't know that is overlooked or assumed to be obvious. Any ideas??
Tym!
|
|
|
|
|
I have a COM+ component which bulk inserts records into a table, which takes 5secs to process one request. If I try executing this component multiple times while it is processing job. SQL server 2000 throws PRIMARY KEY VIOLATION error. How can I lock that table while the component is in process.
Thanks a million
|
|
|
|
|
Did you configure the component to require new transaction?
|
|
|
|
|
hello
i am at work and am using an in house activex (ocx) control
the control is zero size and is hidden on my dialog
(it actually talks to the serial port and i didnt write it )
as usual everything is cool and funky when i run in debug mode
but when i run a release build it falls over when i do things like try and
minimize the app, try and use the menu,
As an exmaple, when i try and use the main dialog's menu (its a dialog based app) the call stack looks like...
CWnd::AttachControlSite(CWnd * const 0x004002f6 {CWnd hWnd=0x00000000}, CHandleMap * 0x008e2528) line 420 + 5 bytes
CWnd::FromHandle(HWND__ * 0x004f0344) line 293
CWnd::OnWndMsg(CWnd * const 0x004002f6 {CWnd hWnd=0x00000000}, unsigned int 289, unsigned int 2, long 4547344, long * 0x0012f1d0) line 1896 + 6 bytes
CWnd::WindowProc(CWnd * const 0x004002f6 {CWnd hWnd=0x00000000}, unsigned int 289, unsigned int 2, long 5178180) line 1585 + 27 bytes
AfxCallWndProc(CWnd * 0x00000000 {CWnd hWnd=???}, HWND__ * 0x004002f6, unsigned int 289, unsigned int 2, long 5178180) line 218
AfxWndProc(HWND__ * 0x004002f6, unsigned int 289, unsigned int 2, long 5178180) line 368
USER32! 77d67b17()
USER32! 77d6cdce()
USER32! 77d4459d()
USER32! 77d447b4()
NTDLL! 77f5108f()
USER32! 77d5779a()
USER32! 77d5b79f()
USER32! 77d6cdce()
USER32! 77d45cc9()
USER32! 77d45ce8()
CWnd::DefWindowProcA(CWnd * const 0x004002f6 {CWnd hWnd=0x00000000}, unsigned int 274, unsigned int 61589, long 21037417) line 1006 + 19 bytes
CWnd::Default(CWnd * const 0x004002f6 {CWnd hWnd=0x00000000}) line 248 + 19 bytes
MRKTLNK! CMrktLnkDlg::OnSysCommand(unsigned int,long) + 163 bytes
CWnd::OnWndMsg(CWnd * const 0x004002f6 {CWnd hWnd=0x00000000}, unsigned int 274, unsigned int 61589, long 4543264, long * 0x0012f64c) line 1931
CWnd::WindowProc(CWnd * const 0x004002f6 {CWnd hWnd=0x00000000}, unsigned int 274, unsigned int 61589, long 21037417) line 1585 + 27 bytes
AfxCallWndProc(CWnd * 0x00000000 {CWnd hWnd=???}, HWND__ * 0x004002f6, unsigned int 274, unsigned int 61589, long 21037417) line 218
AfxWndProc(HWND__ * 0x004002f6, unsigned int 274, unsigned int 61589, long 21037417) line 368
USER32! 77d67b17()
USER32! 77d6cdce()
USER32! 77d4459d()
USER32! 77d447b4()
NTDLL! 77f5108f()
USER32! 77d5779a()
USER32! 77d5b79f()
USER32! 77d6cdce()
USER32! 77d45cc9()
USER32! 77d45ce8()
CWnd::DefWindowProcA(CWnd * const 0x004002f6 {CWnd hWnd=0x00000000}, unsigned int 161, unsigned int 5, long 21037417) line 1006 + 19 bytes
CWnd::WindowProc(CWnd * const 0x004002f6 {CWnd hWnd=0x00000000}, unsigned int 161, unsigned int 5, long 21037417) line 1586 + 19 bytes
AfxCallWndProc(CWnd * 0x00000000 {CWnd hWnd=???}, HWND__ * 0x004002f6, unsigned int 161, unsigned int 5, long 21037417) line 218
AfxWndProc(HWND__ * 0x004002f6, unsigned int 161, unsigned int 5, long 21037417) line 368
USER32! 77d67b17()
USER32! 77d6cdce()
USER32! 77d44435()
USER32! 77d44d38()
does anyone have any suggestions as to how to can tell my app to ignore any exceptions from this naughty ocx?
regards
Bryce
|
|
|
|
|
Are you sure the control is developed properly and anyone else using it doesn't face these problems ,
build an application with nothing but the control on the dialog box if it still crashes its not your fault the control is faulty
or you can use try catch to catch any exceptions and try to ignore them (NOT A GREAT IDEA!!)
Symmetrical is Beautifull
IUnknown is Symmetrical
IUnknown is Beautifull
|
|
|
|
|
thank you for your reply
Monty India wrote:
Are you sure the control is developed properly and anyone else using it doesn't face these problems
All the other apps (VB and used in web pages) seem to work ok
i cant vounch for how well it has been developed as i dont have access to the source code...
but it would appear to the the controls fault (coz when i remove all calls to it my app doesnt crash!)
the control uses callbacks...so catching exceptions is tricky...
how would you trap any/all exceptions from such a control?
regards
Bryce
|
|
|
|
|
Does anyone knows how to wirte Plam Desktop addin ? Or where can find the resources ? Thx.
|
|
|
|
|
Do you mean Palm ? If so, do you mean a conduit ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Same question. Different forum...
I want to host an IE browser control in my application and provide handling for a custom protocol. I figure I just provide the handler in my app, registering on app startup and unregistering on app shutdown.
It looks, however, like the only way to register a custom protocol handler is globally. Which means that as long as my application is running, ANY instance of IE will be elligible to use my custom protocol handler.
Is there some way to register a custom handler for a specific instance of IE? OR do I have to just put up with this "feature"?
J
May the bear never have cause to eat you.
|
|
|
|
|
You have to implement the IInternetSession interface instead, as it lasts the current process lifetime. Look here[^] for more details.
|
|
|
|
|
I think that's what I'm looking for. Thanks.
J
May the bear never have cause to eat you.
|
|
|
|
|
hy, i have read a lot about this topic, but didnt found good answers. can anybody explain, how i can code the following VB-code in VC++ ?
Sub DocumentsExample()
MsgBox(DTE.Documents.Count)
End Sub
How can i get this DTE object? the compiler doesent recognises it.
I would like to make an addin for VC++.NET in which i can manipulate the code. (textmanipulations)
can anybody tell me, how i can do this? i dont know how to do things which i coud do in VB with
activedocument.selection , etc..
thanx for any input!!!
|
|
|
|
|
When you create an add-in, you implement a set of interfaces, and some of them are passed a pointer to the current DTE instance you are looking for. So you don't really have to worry about it. More info here[^].
(DTE is short for IDTExtensibility2).
|
|
|
|
|
unfortunately, i have read all written in your link before. im now working since 2 days at this problem, and i still have no idea how to solve my problem!!!! its making me crazy!
cant you give me a link to a sample add-in (in c++) of an add-in, which simply does the following thing:
clicking on the add-ins button makes, that the currently selected text in VC++.NET (or in Word, id dont care, code will be probably ca. the same)changes, or lets say will be deleted. so you can select some lines of text, click the add-in and the text will be deleted. how can i do this? it cant be this difficult, i think, but i cannot find any explanation of how to code an addin in c++, and no good sample-code
thanx a lot for any help!
|
|
|
|
|
I believe you are confusing an add-in and a macro. Why don't just record a macro, and then examine the produced VBscript code to adapt it to more general needs?
|
|
|
|
|
i dont confuse anything. i cant record a macro because 1. its not possible to records complicated things like those i want to do. 2. my boss told me he explicitly wants all code in c++.
maby i should talk to the boss
|
|
|
|
|
My advice then is to launch VS.NET, create a new project by choosing the project wizard called "extensibility" or something like this, then choose "shared add-in". Doing so, you've got a working skeleton created for you. And one of the methods has the IDEExtensibility2 interface we've been talking about. Using this interface, you can drill down to the current Document object, and get the selection.
My suggestion is also to read this article[^] on MSDN.
|
|
|
|
|
have you checked out this and this?. While the first shows you how to implement IDTExtensibility2 in your addin, the next allows simple text addition to visualstudio via DTE.
Hush,hush...
thought I heard you call my name now.
Kula Shaker.
Amit Dey
Latest articles at CP - PocketPC New menu
Office addin
|
|
|
|
|
is it possible to write IE plugin on a .NET(for example
on C#)?
|
|
|
|
|
Yes. Look up Cp for Custom Explorer Bar or BHO (Browser Helper Objects). I remember I have seen a couple articles about it, using C#.
|
|
|
|
|
I hope I'm not making a complete fool of my self by asking this question and that whoever reads this understands my english...
Trying to use deskbands and have reads alll tutorials and articles forward and backwards (and I have had much use of those found here so thank you) but one thing I can't make work is how to make the deskbar appear autmaticly when I start explorer. Does anyone have any suggestion, help or link? It would be very appreciented.
//Mårten
|
|
|
|
|
I would like to know how to do this too.
|
|
|
|
|
Dear All,
Well this one is a complicated one but please bare with me.
We have an ActiveX Control developed in VB which is used to interface a client DCOM component which then connects to a DCOM server component on another machine.
The application works beautifully when the user are all on the same domain. Unfortunately we need to run the application across domains... I thought ah no problem, there are two methods to fix this:-
1. create two identical local accounts (dcom_su) with same username & password. Run the DCOM Server in the username process, give the user access/launch permissions on the server machine.
Then on the client machine make sure that the user is able to access the DCOM client on the client machine, I also added the user to launch permissions for good luck.
Anyway thats as far as I got.... next I thought about the second method.
2) Setup a trust between the NT/W2k domain.(domains NT<->W2K)
So we setup a trust and then added the the user (W2K\dcom_su) that the DCOM server process was running in to the client DCOM configuration (access/launch) permissions.
We added the user account (NT\simond) that the DCOM client will be running in to the server DCOM configuration (access permissions only). The DCOM server will already be running, so no need to have launch permissions ( i did try it with launch permissions as well just in case, but fortunately it still didnt work, otherwise that would have confused me even more!! )
Anyway load up the MFC prog as NT\simond .. and it didnt work, VB app works beautifully...
AGGGHHH...
When I tested the ActiveX control, the application looks like its working and one of the methods fails due to an Access Denied message.
The funny thing is that I have a VB app which hosts the ActiveX control so I run that and guess what? .. it works fine.. so there seems to be a difference between the way that VB inits ActiveX Controls to VC++, is that true?
I am not using CoInitializeSecurity() as wanted to handle things through the registry. I also have tried to disable DCOM authentication by switching the default connection type to 'none' on the client machine as apparently VB doesnt init DCOM security(which i think is wrong as how come it works through the VB app with security on).
Anyone have any ideas?
Love to hear them..
Anything you dont understand or i have explained poorly just say.
Think this problem is more interesting than most others!!
If I find a solution then I'll post it at least then if any of you have a similar problem you wont have to go through what i have!
TIA
Simon
|
|
|
|
|