|
Hi
1.Register your component under the component services (MTS)
2.Use the export operation in order to create proxy\stub setup file
3.Install the file in the client machine
|
|
|
|
|
Hello !!
I want to convert an object I designed as a custom control in Visual C++ in a ActiveX version. This object is a chart that can display high speed data.
I succesfully converted the control but the problem is for adding new points: I don't want to redraw the complete control (this takes toooooo much time) so I want to get the dc of the control, use a transparent background and plot the line (or point). But this doesn't work if I call the COleControl::GetDC member function (default parameters).
How can I get a dc whenver I want ?? (so, not when OnDraw is called).
And if someaone could send me some example of ActiveX controls this would be great: this is the first time I design ActiveX and this project is REALLY urgent
Thanks a lot for any help (any clue, hints, ... are really welcome )
|
|
|
|
|
Ok !
I've found the solution !
In fact, I added a Method to add these points and I tested the control in the ActiveX control test container. I was invoking the method inside the application. But this seems to work differently... Don't know why
For example if I call this inside my control on a mouse down message,everything works fine...
Why ????
|
|
|
|
|
I'm considering building an MMC (Microsoft Management Console) snap-in. The only information I've found for doing so is the Feb 2003 Platform SDK, where the C++ examples are still from VS6. The VB6 designer for MMC is long gone, and the ATL wizard for MMC was removed from VS.NET (I've heard rumors it was buggy). Which leaves me with the old guts and glory style of raw C++ COM programming. Given the examples in the SDK, that kind of adventure is OK provided there's a real future for MMC.
Does anybody know if Longhorn will still use MMC? Will ATL get a new MMC wizard in Whidbey? Any rumors from Microsoft? Are there any good newsgroups for MMC?
Any hints will help me here - Thanks,
Richard
|
|
|
|
|
It's still in the PDC build of "Longhorn". I doubt Microsoft would abandon it yet, though. It still serves a good purpose and uses the ubiquitous tree that everyone loves.
I know they recently acquired a new project for remote server maintenance, but this doesn't seem to overlap with problems solved with MMC.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How would I go about converting a dragged stream object, into a dropped file object? The stream would be a stream of bytes dropped into the windows shell (explorer / desktop etc).
I get the impression I would need to implement my own DataObject that implements IDataObject, and load it with the appropriate STGMEDIUM and FORMATETC structs representing a stream.
Then, when dropped, a new file object needs to be created exposing some storage interface (IPersistStorage, or IStorage?), and then this needs to be given the IStream interface of the stream that is being dropped into it. Following that, i'm assuming windows shell can handle it.
How close am I?
(Note: The drop source is a wrapped managed C# interface, i can create a new stream object implementing the IStream interface, and read in my serialized bytes to it. The problem above is where i go from there.)
Cheers
Cata
|
|
|
|
|
Again, you're making this much too hard. The implementation of the IDataObject is nothing more than a way to encapsulate all the information about an object being dragged (or copied to the clipboard).
The STGMEDIUM and FORMATETC structs describe how the data is contained, and what the data is, respectively. You provide either an IStorage (not IPropertyStorage , which is very different) or an IStream implementation in the STGMEDIUM , as well as setting the tymed field to the associated enum type. Set the clipboard format in the FORMATETC struct. Pack your data and these structs into your IDataObject implementation and call DoDragDrop with that, your IDataSource implementation (which you can easily create from a .NET
Control</cod> since I know that's what you're after), also specifying your allowed effects.<br />
<br />
When a possible drop target gets the drag over event, it looks at the <codE>FORMATETC and allowed effects to see whether or not it can except it. It may also look at the STGMEDIUM to see if it can accept data passed along in those formats (the shell should handle all of them just fine). It then alerts the drag that it can accept them. If a user drops the data, the drop target gets the storage object from STGMEDIUM and handles it appropriately. If it's a filename, it would copy, move, or link them (depending on the effects). If it was an IStream implementation, it would get information about the stream and Read till done. If it was locked in global memory it copies it out and frees the global memory. So on, so forth.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello ! I use the MFC ActiveX ControlWizzard
I'm really new to ActiveX development. I want to know if it is possible to have another ActiveX in the current ActiveX I'm developping (like a class member of the Ctrl class) ? If yes, how (and when) do I have to create the control ???
I'm a little bit lost
And by the way, if you have some links to good tutorials, they are welcome !
Thanks!
|
|
|
|
|
Yes use the composite controls.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
Thanks for the response...
Hum, sorry but can you be more specific ?? I'm really new to this and I really don't know what is composite controls...
Thanks
|
|
|
|
|
A search on MSDN will give you the sol and that would be muct detailed explanation.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
I have written a quite complex dialog-project using MFC C++. Now I would like to distribute it on the net. My only thought is to “convert” it to an ActiveX but are there any other good ways?? Pleased for suggestions.
If an ActiveX is the “best” solution, how to make it quick?
.....and justice for all
APe
|
|
|
|
|
ok, i got the com object to register using the
<br />
DECLARE_REGISTRY_RESOURCEID<br />
macro
however there was something wrong with the RGS file that made it unable to unregister it. please look at this RGS file:
HKCR
{
NoRemove AppID
{
'%APPID%' = s 'TestAgent'
'TestAgent.DLL'
{
val AppID = s '%APPID%'
}
}
NoRemove Folder
{
NoRemove ShellEx
{
NoRemove ContextMenuHandlers
{
ForceRemove TestAgent = s '{7BA0D1BF-0B50-4B3A-B8E5-229B9D97C282}'
}
}
}
NoRemove *
{
NoRemove ShellEx
{
NoRemove ContextMenuHandlers
{
ForceRemove TestAgent = s '{7BA0D1BF-0B50-4B3A-B8E5-229B9D97C282}'
}
}
}
}
it's the first section (NoRemove AppID) that is causing the problem making ATL unable to UNregister the server. It has no problem registering it. That part is generated automatically by Visual Studio. Removing it fixes it. Why doesn't it work? Is it needed?
on a side-note, how did i find out? by manually overriding DllRegisterServer and DllUnregisterServer, i found out that this call failed:
if( this->UpdateRegistryFromResourceS(IDR_TESTAGENTPROJECT, FALSE ) != S_OK )
{
MessageBox( NULL, "ureg bad 2", "!", 0 );
return false;
}
the counter-part, registering, went flawlessly... really wierd for me..
thanks, appreciate the help.
|
|
|
|
|
How can i use the IBidiSpl COM interface in either VB.NET or C#.NET.
My major problem is knowing which type library that defines the interface because i have gone through the documentaion in the msdn with the hope that i will get a clue but no way.
I would welcome any suggetion that will enable me know the type library that implement it.
|
|
|
|
|
How do I call the Task Manager or the Job Scheduler of SQL Server
from an application. I am developing using C# but examples using VB would be great.
Adam
|
|
|
|
|
hi there
I have a very strange problem I hope you can help me sort it out.
I need to share a hashtable between multiple process (right now 2 is enough...), so I made a com+ class, made it a Singleton, inherited from ServicedComponent, registered it as a server application within "Component Service" and put it in the gac.
We'll call this class "Container"
I'm having problems sending that container the elements to put in the hash-table.
At first I made them as simple as possible, then I got an error that the class isn't serializable, so I figured that happenned because it tried passing param by value. Because I want to pass parameters as references, I made the object inherit from MarshalByRefObject instead . (We'll call this class HashObject)
Now the solution compiled, and I even called stub methods inside the Container which worked, but when I try to actually call Hashtable.Add() inside the com+ container I get an exception: System.runtime.remoting.remotingException telling me my server hasn't got a sink to use or the application doesn't have a client sink.
I know that by using com+ I'm actually using remoting as well, but why do I get that exception when I'm trying to read the values of the object I sent to the Container ?
The weirdest thing is when I made Container accept System.string instead of HashObject, it could read the string. (but not a string within HashObject in the first configuration)
I'd really appriciate any help or suugestion you might have
Thanks
Yoav S.
|
|
|
|
|
I found the solution
apparently- you can't use MarshalByRefObject in com+ , only in .net remoting.
so all information travels should be made "by value" and not "by reference".
hence all the objects passed to a com service must be serializable or implement ISerialize.
until next time
Yoav S.
|
|
|
|
|
hello!
i have a shell extension that registers on the contextmenu on folders and files. it worked fine until we migrated to visual studio 2003. the RGS file simply doesn't register!
i have looked inside the DLL that is created, and i can see that the information is there. it just isn't transferred to the registry upon registration.
it's easy to reproduce: create a new ATL project, add an ATL simple object, and compile. i rely on the (default) post-build-action "performing registration", that does the regsvr32.exe /s /c my.dll. yes, i can register it successfully manually. i am the only user on my computer, so its fair to assume i have admin rights (windows xp).
this is the looks of the basic RGS file that comes with the new project:
HKCR
{
NoRemove AppID
{
'%APPID%' = s 'TestAgent'
'TestAgent.DLL'
{
val AppID = s '%APPID%'
}
}
}
the thing is, the dll does contain all the information from the RGS file (i can see it). the dll gets "successfully" registered, but NOTHING from the RGS file gets transfered to the registry. there ARE things coming into the registry (CLSID, TypeID etc) but those things are not from the RGS file.
i have no idea what i have done wrong. how can you tell visual studio to mark the RGS resource file so that regsrv32 transfers it to the registry? i thought that was automatical. it just isn't so in "my environment" for some strange reason.
i would be SO glad if someone could help me out, you wouldn't know! i've been on this for so long my hair has changed color. maybe there is something wrong with how i create the project.
/daniel
|
|
|
|
|
First up, a bit about mechanisms. RegSvr32 knows nothing of .RGS scripts. It only knows how to call DllRegisterServer , a function that your DLL should implement (along with its counterpart, DllUnregisterServer).
ATL offers support in CComModule (ATL pre-7.0) or CAtlDllModuleT (ATL 7.0+) for registering servers. ATL provides the parsing for the registry information. In order for ATL to register your class 'automatically', it must appear in the module's object map, and it must have an appropriate DECLARE_REGISTRY_xxx macro in the class.
The first thing to do is to check that these conditions are met.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
first of all, thank you very much!
when i worked with Visual Studio .NET (not 2003), I didn't have to think about any of that. How come it has changed like that?
Previously, the RGS file registered automatically without any macros or something like that. Then DllRegister/Unregister must have had a more rigourous standard implementation in the last version of Visual Studio, making things wierd for me. The agent worked flawlessly before, for a year or so until i transfered my whole project to visual studio 2003.
do you know of any good resources where i can learn about that? I'll make a search right away.
|
|
|
|
|
first of all, if I add in my class
<br />
DECLARE_REGISTRY_RESOURCEID(IDR_MONKEY) <br />
i get:
warning C4199: Cannot inject full attribute code due to duplicate member: UpdateRegistry
also, this code created by the wizard:
<br />
[ module(dll, uuid = "{65B6EA97-CE45-4D29-8928-E305C8DD7C9A}", <br />
name = "Monkey", <br />
helpstring = "Monkey 1.0 Type Library",<br />
resource_name = "IDR_MONKEY") ] br />
class CMonkeyModule<br />
{<br />
public:<br />
};<br />
even has a reference to the RGS file (IDR_MONKEY)
and states they are automatically implemented.
please give just a tiny little bit more of help
|
|
|
|
|
Hi,
How i can access or know about DLL files function . so i can use it in my code?
Regards
Ali Alaradi
|
|
|
|
|
While this is not a COM specific question, I'll try and answer it anyway.
The DLL (any DLL) will have 'exported' functions (and possibly data). You can use LoadLibrary to get the DLL into memory (so you can call code in it), and use GetProcAddress to find the entry point for a given function.
However, there is no guarantee that the DLL itself contains enough information for a 3rd-party to use the DLL, unless they also have documentation or perhaps a header file that describes the function names, their parameters and types.
Without those, you can't reliably use the DLL. However, some DLLs, authored in VC++, from C++ rather than C files, may contain decorated names. These will include parameter lists, including types.
Something like the dependency checker (part of the Platform SDK) can be used to examine a DLL.
Steve S
|
|
|
|
|
Thanks My friend.
regards
Ali Alaradi
Developer
|
|
|
|
|
Hi
Anyone in here who knows how to modify the properties of a MSChart ActiveX control embedded in a web page using Javascript?
I have managed to set a few properties (like Title, ChartType) that are displayed correctly, but when I try to fill the ChartData property with my own data nothing happens, and afterwards no other property can be set either.
Code snippet:
<html>
<head>
<script type="text/javascript">
function f()
{
var c = document.getElementById("MSChart1");
c.Title.Text = "Title";
c.FootnoteText = "Foot Before";
c.AllowSelections = false;
c.ChartData = [[10,20,30],[5,10,15]];
c.FootnoteText = "Foot again";
}
</script>
</head>
<body onLoad="f();">
<OBJECT ID="MSChart1" CLASSID="CLSID:3A2B370C-BA0A-11D1-B137-0000F8753F5D" CODEBASE="MSChart5.OCX" width="400" height="300">
</body>
</html>
Thanks
/Marabou
|
|
|
|
|