|
Uwe Keim wrote:
The guy metions a function getDllClassObject, which must be written by the autor of the book he mentions. Since I don't have the book, maybe I should buy it? Or do you know how the function probably works?
No it's probably just a VB wrapper around the native call, he is refering to DllGetClassObject[^] which you can implement yourself. It's returning a class factory based on the CLSID of the coclass and the interface being requested.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Sounds reasonable, thanks! Do you know any way to implement this function (DllGetClassObject ) from a managed COM DLL?
E.g. I once wrote a managed COM DLL where I applied the [System.Runtime.InteropServices.ComRegisterFunctionAttribute()] to a function to provide the registering functionality.
So I guess there must be a similar attribute or something like that in the System.Runtime.InteropServices namespace?!?
--
Affordable Windows-based CMS: www.zeta-producer.com
|
|
|
|
|
Uwe Keim wrote:
Sounds reasonable, thanks! Do you know any way to implement this function (DllGetClassObject) from a managed COM DLL?
You can simply create a class factory in your .NET code. Make sure you just return an interface pointer to the created class. You can use the standard C-style casting mechanism as well.
private IFun GetFunObject(string strType)
{
IFun iFun;
if(string.Compare(strType, "SomeClassName") == 0)
{
iFun = (IFun) new Fun();
}
return iFun;
}
interface IFun
{
void HaveFun();
}
class Fun : IFun
{
void HaveFun()
{
}
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Remember that VB6 (or older) != VB.NET...er, <> VB.NET! Completely different runtime.
GetDllClassObject has to be a natively exported function, just like DllRegisterServer , DllUnregisterServer , etc. This isn't possible with the managed compilers, though if you wrote your own compiler you could inject implementations or relocate calls to a bootstrap DLL (this is actually how VB6 and many other executables work - the entry point is actually a redirect to another library that calls back into the PE/COFF executable).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I need to show a drawing surface that is the same size as the default printer page but which is a user control. Then I need to scale it for better viewing. What would be the best approach to take on this one? I am a little bit stymied.
Thanks
|
|
|
|
|
|
Does anyone know how to get the commandline parameters of an externally created process?
The Process class gives you the StartInfo property which includes "Arguments". This works great if I want to start my own process. However, I've found that it never contains the arguments used to start an external process that my program didn't start. It's always empty.
In C, there's a Win32 call for GetCommandLine() which would work great... except it only works for the calling process, not an external one.
SysInternals' "Process Explorer" does this without any trouble for any process so I know it can be done. Any help? I don't care if it's C/C++, VB, VB.NET, or C#.
Thanks
|
|
|
|
|
Did you ever figure this out ?
|
|
|
|
|
Yeah, I ultimately did in C++. I wrote a wrapper in ATL COM so I could easily use it in a C# project I was working on at the time. Unfortunately the hard drive it existed on was lost when the project was shelved a couple years back. I MAY have a backup still on another drive at the office. I can dig that up for you if you really need it, but it will need to wait until Monday. If you can't, then look into examining the PEB (process environment block). I think it had something to do with NtQueryInformationProcess but I'm not sure. You can get the processID of the process you want to query with the .NET classes, then jump into the lower level API calls to get the rest.
Hmmm, maybe there's an actual article in there for CP. I hadn't thought about that before.
|
|
|
|
|
hi,
how to use datagrid for making invoice and purcase orders and so on. any one help to me. if possible with small sample.
Thanks in advace!
Have A Nice Day!
Murali.M
|
|
|
|
|
It's very tough to get a ready made customizable Grid. What you need to do is, play around with your logic.
I wrote an article on DataGrid formattings. This will help you to customize your figures(numbers) in desided fasion. apart from this please check this link, which contain lot of tips and sample tutorials which will guide you to reach your place.DataGrid Gal
Sreejith Nair
[ My Articles ]
|
|
|
|
|
This is a great Windows Forms FAQ and has a few examples of datagrid formatting:
WinForms FAQ[^]
Gary
While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'
- Dilbert
|
|
|
|
|
Hi,
I remember that there's an object stream writer in Java which makes it easy to save objects into files. What class is this in C#?
Rafferty
|
|
|
|
|
You can use the BinaryWriter, or, for a higher level solution, BinaryFormatter with the [Serializable] attribute on the class.
Yes, even I am blogging now!
|
|
|
|
|
How i can handle request from client and repond to client in Microsoft IIS 5.0 or more? What do i need? Or some information? Thanks
Nothing
|
|
|
|
|
|
That's a very generic question. A "request" can mean anything, a web serivce, web page, authentication, ...
You'll have to be MUCH more specific about what you want to do before anyone can help you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It's like program a windows service that can get the request from user like "username","password" and this service will get some information from internet and send to that user.
Nothing
|
|
|
|
|
You don't need a service for that, just a normal ASP.NET project will work. Still, your requirements are very vague...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Did you have some examples for me
Nothing
|
|
|
|
|
Examples of what? You haven't said anything about your app is supposed to do what-so-ever. The only thing you've made clear is that you want to return some data via a web browser. Every web site on the planet does that. At this point, I would suggest picking up a book on ASP.NET/VB.NET and learning the basics of ASP.NET development.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a video server which can sent mpeg2 streams via internet and I want to watch this mpeg2 streams on my ipaq pda, how can I do this with c#, is there a mpeg2 player, decoder, SDK for this purpose? can windows sdks help me? any idea will help,thanks.
|
|
|
|
|
I'm planing a project to administrat a Windows Server.
The project is splited into 3 parts.
User Interface: a Windows application where the Users set all their properties to the Windows Server
Server Manager: a Windows service which manages a database with all setting
Server Admin: to execute the commands given by the Server Manager
the Server Manager has a database with permissions for each user or usergroup, it manages the communcation with the User Interface and the Server Admin.
the Server Admin is needed to execute all command, because some Windows Services, espezialy for the pre-COM-time dont work with .NET and need changes to be put into configuration files.
i.e. Apache
all application communicate over .NET Remoting (binary, not over HTTP)
Now it is nesseccary that the User behind the User Interface has only access to methods and objects, which are for him.
i.e. a user User1 has the right to add a VHost Alias into his part of the Apache-Configaration
where as the Admin has the right to read and write all setting incl. the settings of the user.
so the user has no right to see the ApacheConfigarationClass, only the ApacheVHostConfigartionClass
i thought of a mechanismn to control the right to create an object....
a next problem is to distinguish between 10 or more user logged in...
sorry i'm a newbee in remoting *g*
*g* Copyrights © 2003 by Paebbels.net *g*
|
|
|
|
|
i'm trying to get a directx form to display as a child form in an mdi. i can't get it to run however. my reasoning behind this is so that i can have a configuration form and a directx windows up at the same time. then when i adjust the vales in the config window it updates the cooresponding values for the directx scene. i just can't get the directx form to keep rendering itself. here's some snippets, i hope you can help me.
when the MDI form loads...
RJSS.frmMain frm1 = new RJSS.frmMain();<br />
frm1.MdiParent = this;<br />
frm1.Show();<br />
<br />
RJSS.frmDD frm2 = new RJSS.frmDD();<br />
frm2.MdiParent = this;<br />
frm2.Show();<br />
declarations in the directx form...
private DD.Device ddDevice;<br />
private O2.SpriteManager sm;<br />
private Open.HighResolutionTimer hrt;<br />
when the directx form loads...
DD.PresentParameters pres = new DD.PresentParameters();<br />
pres.Windowed = true; <br />
pres.SwapEffect = DD.SwapEffect.Discard;<br />
<br />
this.ddDevice = new DD.Device(0, DD.DeviceType.Hardware, this, DD.CreateFlags.SoftwareVertexProcessing, pres);<br />
<br />
this.hrt = new Open.HighResolutionTimer();<br />
this.sm = new O2.SpriteManager();<br />
this is what won't process. if i try to call this function the program just crashes out stating An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll
protected void Render()<br />
{<br />
this.sm.Update(this.hrt.ElapsedTime);<br />
<br />
this.ddDevice.Clear(DD.ClearFlags.Target, Color.Black, 1.0f, 0);<br />
this.ddDevice.BeginScene();<br />
<br />
this.sm.Draw(this.ddDevice);<br />
<br />
this.ddDevice.EndScene();<br />
this.ddDevice.Present();<br />
}<br />
any help is greatly appreciated.
thanks,
Rob Tomson
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
In vb6 I used a the Heiricial grid control to display data. I have also used it in a few c# projects, but I do not like having to include the extra files in to the installation. Is there a way to use the standard datagrid to do this? The HGrid is easy to use as far as editing a record etc, and I would need the same things from a regular datagrid.
Thanks for your help
Mike Deming
|
|
|
|