|
OK. That makes perfect sense.
I've read some more about this stuff and some people mention that its possible to call TDI (Transport Driver Interface) directly. How can this be done?
|
|
|
|
|
Look into DeviceIoControl
Alex Korchemniy
|
|
|
|
|
Hello
I found a bad bug in the TabedReBar Sample http://www.codeproject.com/docking/TabedReBar.asp . If the toolbar is floating, some buttons, which are related to the doc/view are desiabled(Like the Save Button). But if the toolbar is docked, they are enable again.
why?
is there any solution out there?
|
|
|
|
|
While using Visual C++.Net I keep getting error C1190 with the following code. Please Help!
// animals.cpp : Defines the entry point for the console application.
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
_gc class Animal
{
public:
int legs;
void SetName(String *name)
{strName = strName->Copy(name);}
String* GetName() {return strName;}
private:
String *strName;
};
int_tmain()
{
//TODO: Please replace the sample code below with your own.
Animal *cat,*bird;
cat = new animal;
bird = new animal;
cat->SetName("Cat");
cat->legs = 4;
bird->SetName(Bird");
bird->legs = 2;
Console::WriteLine("Animal 1");
Console::Write("Name: ");
Console::WriteLine(cat->GetName()):
Console::Write("Legs: ");
Console::WriteLine(cat->legs);
Console::WriteLine();
Console::WriteLine("Animal 2");
Console::Write ("Name: ");
Console::WriteLine(bird->GetName());
Console::Write("Legs: ");
Console::WriteLine(bird->legs);
Console::WriteLine();
return 0;
}
|
|
|
|
|
( seems some of your code is missing ... )
the Documentation for error C1190 says that you need to have
#using < mscorlib.dll>
in your code somewhere, I don't know where, because I'm not familiar with Managed C++.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
For example i got next architecture:
class BaseClass
{
virtual void Method1();
virtual void Method2();
};
class FuncClassOne: public BaseClass
{
void Method1();
void Method2();
};
class FuncClassTwo: public BaseClass
{
void Method1();
void Method2();
};
class Grup
{
BaseClass** m_ppObjects;
void CallAllMethods();
void Add(BaseClass* pBaseClass);
BaseClass* GetObject(long ObjectID);
};
So, i want to save this architecture and place everything in COM;
Let me try to explaint what i need (I imagine ):
IGrupPtr group(CLSID_Grup);
for(int i = 0;i<10;i++)
{
IFuncClassOnePtr p(CLSID_FuncClassOne);
group->Add(p);
}
for(int i = 0;i<10;i++)
{
IFuncClassTwoPtr p(CLSID_FuncClassTwo);
group->Add(p);
}
group->CallAllMethods();
BaseClass* pClass = group->GetObject(7);
So how can i make frome every class COM Interface?
Is it possible? Or i need to choose another way???
|
|
|
|
|
Their is quite alot of things that go into making a COM object, however to set you in the right direction:
1. your 2 interfaces I am assuming will be FuncClassOne and FuncClassTwo. To do that you need to define them as such (BTW all COM interfaces derive from IUnknown)
interface FuncClassOne : IUnknown
{
virtual void __stdcall Method1() = 0;
virtual void __stdcall Method2() = 0;
}
interface FuncClassTwo : IUnknown
{
virtual void __stdcall fc2_Method1() = 0;
virtual void __stdcall fc2_Method2() = 0;
}
2. Now you will need your COM object, containing your interfaces and the implementations.
class FuncClass : public FuncClassOne,
public FuncClassTwo
{
public:
virtual HRESULT __stdcall QueryInterface(REFIID iid, void** ppv);
virtual ULONG __stdcall AddRef();
virtual ULONG __stdcall Release();
virtual void __stdcall Method1();
virtual void __stdcall Method2();
virtual void __stdcall fc2_Method1();
virtual void __stdcall fc2_Method2();
FuncClass();
~FuncClass();
private:
long m_cRef;
};
3. Now you need to implement your COM functions
This was really just so you could see the COM implementation in C++ for what you were asking (At least I hope it was what you were asking). You really should look on MSDN for what is required to implement the COM functions and how to create CLSIDs and register your component. Unfortunately the topic is just too large to be answered fully, on this post. I hope I at least got you going in the right direction and knowing what to look for now.
|
|
|
|
|
Thank you for participating i tried to do something like you show me:
So I made an ATL Project, and in the midle file i wrote next thing:
[
object,
uuid(BFBF8B9C-64BF-42bc-82D5-8564B637012B),
dual,
nonextensible,
helpstring("IAbstractGeoObject Interface"),
pointer_default(unique)
]
interface IAbstractGeoObject : IDispatch
{
[id(1), helpstring("method Draw")] virtual HRESULT Draw() = 0;
}
[
object,
uuid(16578C15-F715-4A3A-94E7-70C1387A53B7),
dual,
nonextensible,
helpstring("IGeoObject Interface"),
pointer_default(unique)
]
interface IGeoObject : IAbstractGeoObject{
[id(1), helpstring("method Draw")] HRESULT Draw(void);
};
But it doesn't want to compile it... It shows next error message:
"Expecting a type specification near "virtual""...
So i'm in the dead end...
|
|
|
|
|
Hi,
I made a button that when you press it opens a CFileDialog,
I want it to open excel file with the excel program (excel XP or excel 2003)
after downloading each and every example there is I still couldn't found how do I do it.
you can open the file if you are right clicking the file and then choosing open, but I want it to do the same when you are doing open through the panel
please help me..
Lani
|
|
|
|
|
have you looked at ShellExecute()?
|
|
|
|
|
Hi
I was wondering if anyone knows the minimal code necessary to play a sound file of whatever sort (mp3, wave, whatever else...) at different speeds and/or in different directions (back or forward). Basically I'd like to make a super simple
turntable program... something with a "load" "play" and "stop" button and a slider that decides speed and direction of
your song...
thanks for any advice.
fred
|
|
|
|
|
I haven't done much code in this area... but look into the Windows Media Player SDK. It not going to be the most efficient solution but it sure is the laziest one.
Alex Korchemniy
|
|
|
|
|
Please let me know about the basics about .odl file, it's creation and purpose.
Any kind of suggesion or link to the particular documentation will help me a lot............
looking for your immediate response...
|
|
|
|
|
I want to enlist various file types much like that enlisted in Search >> For files and folders >> type >> combobox of Windows Microsoft 2000 Professional.
that is.... known file types on system along with name and icon...How is that done.
|
|
|
|
|
I want to enlist various file types much like that enlisted in Search >> For files and folders >> type >> combobox
that is known file types along with name and icon...How is that done.
|
|
|
|
|
I have an edit box on property page. I want to fetch its value in my formview.cpp . Then how is that done ? Can Some one help me out.
Thanx in advance.
Drushti
|
|
|
|
|
Miss Nazar,
if you know the ID of the EditBox you can use following api to retieve the value
1.GetDlgItemText<br />
2.GetDlgItemInt
or I think you are using MFC , just add the variable to
the EditBox using MFC ClassWizard>>member variable,
and When ever you need the value just Call
UpdateData(TRUE); and you variable will
fill with value present in Editbox
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
|
How do I modify values (Comments, CompanyName, FileDescription, LegalCopyright, etc) in the StringFileInfo block of an external EXE resource?
Sample code would be greatly appreciated!
|
|
|
|
|
I don't have sources but there is no magical api that will do this(as far as I know) you havve to open the file and write to it replacing the info you want to replace with your info.
To know what to replace you need to lear about PE headers so you can find where the info is stored and overwrite it.
That's all I know on the subject,
hei, if you manage to do this send me the source to ok?
|
|
|
|
|
Hi Spiritofamerica. Thanks for the heads up on PE headers. I'll have to look into it. If I manage to find a solution. I'll make it available.
|
|
|
|
|
Just a guess, but have you tried using UpdateResource(..., RT_VERSION, ...) ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have Seen many people debuging there dll when they are running under context of some other application and they are able to set break point tooo.
i am too use to bebug with help of MessageBoxes(Yeah it Silly,but work for me ) but now it not working as i have to make a LSP Dll.so what i need to DEBUG any runnign DLL.
Hope somebody understand my Problem . PLEASSSSSSSSSeeeee
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Well , if you are using Visual Studio IDE,
Press F9 to set a breakpoint in the source file.
Then, Go to :
Project>>Settings>>Debug TAB
In the "Executable for debug session:" Edit box, BROWSE and select the EXE file that is going to use your dll.
THEN PRESS 'OK'
NOW RUN YOUR PROGRAM BY CLICKING THE '!' ICON OR ON THE TOOLBAR...or <ctrl+f5>. THIS WILL RUN THE EXE THAT YOU SELECTED EARLIER.
NOW IF THAT PROGRAM(EXE) MAKES USE OF AN EXPORTED FUNCTION FROM YOUR DLL, AND IF YOU HAVE SET UP YOUR BREAKPOINTS CORRECTLY, YOU CAN DEBUG YOUR DLL......
happy debugging!
...Avenger
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
|
|
|
|
|
Thank You sir!
actually my problem is I am developing Layered Service Provider DLL(which will filter all the call make through the WINSOCK DLL)
now i don't know which exe is handlling the call or filtering Winsock request.
Now what i DO
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|