|
If the interface had already been published then yes
you should give it a new name but for testing I don't
think that is really relevent.
Thank You
Bo Hunter
|
|
|
|
|
Hello,
i am a beginner at COM. Please tell me if its necessary to create class factory to make a COM object. If not then when is it exactly necessary.
Thank you
|
|
|
|
|
Yes, it is COM rule that declares that COM server should present own class objects (i.e. class factories).
With best wishes,
Vita
|
|
|
|
|
Solution: Compile and register proxy DLL.
I am curious though as to what proxy I got back in the client process. One would imagine QueryInterface() should bite me when I try to query for an interface for which it, obviously, cannot proxy. It seemed as if it was giving me a proxy for a totally different (but class related) interface - vtable order and parameter signatures seemed to matter. Other methods than DoOperation worked if and only if they matched another interface's vtable order/method signature.
This is my scenario:
I have an exe automation server. I register an object in the running object table. The object exposes this interface:
[ ... ] interface IY : IDispatch {
[id(y)] DoOperation();
}
[ ... ] interface IX : IDispatch {
[propget, id(x)] Y([out, retval] IY** ppY);
}
Registration of the object in the exe server works just fine, and so does acquiring the object in the client application. The call to IX::get_Y() works without flaws as well. However, calls do IY::DoOperation fails miserably. It crashes in an instance at 0x00000000 - it tries to execute code at that adress..
Sounds like the proxy object has a screw loose. Has anybody dealt with a similar problem before? If so, care to share a solution?
--
You copy and paste yourself into my brain.
You always find your way back into my brain.
|
|
|
|
|
hi,
I have a problem when releasing the IDirectInput8Device interface as below.
if (m_lpdirinde8Device)
{
m_lpdirinde8Device->Unacquire();
m_lpdirinde8Device->Release();
m_lpdirinde8Device = NULL;
}
But it hangs at the release. This happens only if I create an effect on this device. Can somebody give a hint why release hangs?
Thanks
Manju
|
|
|
|
|
I don't know exactaly what may have caused the Release to crash from looking at the code you listed, but the last time this happened to me was when my IUnknown:Release was called while there was a pointer still open or a memory buffer that was not closed/freed (be it a string without an end character or a Malloc-ed memory space) before the call to Release.
This MAY be the problem, as it what causes a similar problem for me, but there could be other factors, like an improper declaration of the Release in your COM class declaration and so on.
|
|
|
|
|
I'm a bit confused about Exchange client extensions vs Outlook rules implementation. How do I write a custom rule for Outlook in the context of a C++ COM addin? I think apart from the COM addin support I just need to implement IExchangeRuleXXX(),IExchExt interfaces and register the dll as an Exchange client extension?
Thanks for your time.
|
|
|
|
|
I've tried to used this article http://www.codeproject.com/csharp/CsAutomateWord.asp?target=Word to create a character sheet.
I have a CCharacter class, that contains all information about a character, and I want to generate a MS Word document with these information.
So I've created .dot document, with thinks like
Name _Name_ Age _Age_
in arrays (I've tried also without the array, directly in the text). _XXX_ is code that I will use for replacement.
Now, to the code:
// Create a Word application
Word.ApplicationClass vk_word_app = new Word.ApplicationClass();
// Open the .dot
object FileName =Directory.GetCurrentDirectory()+"\\Models\\Sheet.dot";
Word.Document vk_my_doc = vk_word_app.Documents.Open(...
// Create a new document
Word.Document vk_new_doc = vk_word_app.Documents.Add((...
// Copy the .dot into the new document
vk_my_doc.Select();
vk_word_app.Selection.Copy();
vk_new_doc.Select();
vk_word_app.Selection.PasteAndFormat(Word.WdRecoveryType.wdPasteDefault);
// close the .dot
vk_my_doc.Close( ref vk_false, ref vk_missing, ref vk_missing );
All the previous steps work. I get a new document, build from my template.
Now, I'd like to fill it with actual information. So I do this
// Select the new doc
vk_new_doc.Select();
// Define some variable
object vk_false = false;
object vk_true = true;
object vk_num = Word.WdFindWrap.wdFindStop;
object vk_find = "_Nom_";
object vk_replaceWith = Name_Familly; // This one is a member of CCharacter class
object vk_replace = Word.WdReplace.wdReplaceOne;
// Try to replace the text
vk_word_app.Selection.Find.Execute( ref vk_find,
ref vk_false, ref vk_false,
ref vk_false, ref vk_false, ref vk_false, ref vk_true,
ref vk_num, ref vk_false,
ref vk_replaceWith, ref vk_replace, ref vk_false,
ref vk_false, ref vk_false, ref vk_false );
And... it doesn't work.
I got this error:
System.Runtime.InteropServices.COMException (0x800706F7): Le relais a reçu des données incorrectes.
at Word.Find.Execute(Object& FindText, Object& MatchCase, Object& MatchWholeWord, Object& MatchWildcards, Object& MatchSoundsLike, Object& MatchAllWordForms, Object& Forward, Object& Wrap, Object& Format, Object& ReplaceWith, Object& Replace, Object& MatchKashida, Object& MatchDiacritics, Object& MatchAlefHamza, Object& MatchControl)
My form close, the word doc stays opened.
"Le relais a reçu des données incorrectes" would translate as "incorrect data received".
Any idea of a way to solve this would be greatly welcomed!
|
|
|
|
|
I want to figure out how exaxtly Remember my password and username is implemented in messengers or any desktop application say Yahoo messenger.
|
|
|
|
|
There is no concrete way. Remember that any key you use to encrypt such information can relatively easily be extracted and used to decrypt passwords, so don't do that.
A good mechanism would be to hash the password using MD5 or SHA1 (both good hash algorithms) before transmitting across the 'net or storing. These two algorithms are mathematically proven to be irreversable. If the user has the "Remember Password" option checked, then read the value from a file or the registry - which is the password hash - and transmit it without hashing it again (which is also hingent on whether "Remember Password" is checked). This is pretty good for secure storage, as well as somewhat secure transmission.
On the server side, you simply store the password hash and compare the hash sent by the user with the hash stored in the database (or whatever).
One warning, though - sending just the hash is subject to replay attacks. If someone intercepts that hash, they merely have to send it with some program they could right and get access to the user's information. Instead, before sending the hash, request another hash that is used to hash the password hash, but that hash should be reversible. When it gets to the server, extract the original password hash and compare. This is known as a challenge-response mechanism, and there's several ways to do it. Trying googling for more details. Note: digest authentication in web browsers use this mechanism, so you could start there if you like. There is an RFC for it, so try looking at IETF RFC Page[^].
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
That was highly Fundu stuff. Need time to digest it. Then I will get back to U.
Thanx
|
|
|
|
|
I want to develop a application which will connect me directly to yahoo messenger window. i.e entering username and password in Login window will be handled by my application. Don't know how to do it?
|
|
|
|
|
I am not familiar with the workings of the Yahoo messenger and its server.
Sounds like you want to develop a custom client. One solution is winsock. Just look up the protocol that the message server understands.
Kuphryn
|
|
|
|
|
That is the problem I am facing. There are no standard protocols. I just want to some how write in the Edit Boxes and I am done with it
|
|
|
|
|
hi there..
thanks for your time..
i needed to know if its possible to know if a control is UI Activated already or not? and secondly which function is called when a control is UI DeActivated?
regards
safee
|
|
|
|
|
|
Hi there
Using the API GetAmbientUserMode() , this tells whether the container is in run-mode (TRUE) or design-mode (FALSE).
regards
Abhishek Srivastava
Software Engineer (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
I'm quite new to VC++ programming. I need to develop an application which has independent pluggable modules (DLL ?) with the core application passing some arrays of data to the plug-ins and getting back the processed data from the plug-in. The core application should run without error even if any corresponding module (plug-in/DLL) is missing at run-time. The core application should also be able to detect any new plug-in and load it dynamically. Any changes to the plug-ins should not require the core application to be re-built.
Grateful if anyone could advise the best possible solution to the above mentioned task - use explicitly linked DLLs or use COM ? Any sample codes or articles available for this?
I'll be using VC++ 6.0. Thanks a lot in advance !
|
|
|
|
|
You will probably get far more helpful, and a greater number of replies in the VC++ forums.
Though your search for an answer will almost certainly lead you back here at some point or another
Cata
|
|
|
|
|
Hi,
I'm just starting to use COM dlls but have come across what I believe must be a common problem for brainwashed MFC folk... absolutely any suggestions would be welcome!
I have a standard Windows app generated using Visual C++ V6.0 which uses a CRichEditCtrl control. The app is served by several COM dlls.
I would really like to dedicate one of the COM dlls to displaying the information in the CRichEditCtrl control. The problem is how do I tell the COM dll the pointer to the control?.
I have tried passing the control window handle (hwnd) and then using SendMessage(hwnd,,,). Thats OK for raw text but when I want to (say) get the defaultcharformat I really need the control's CRichEditCtrl* pointer.
I guess I could pass a void ptr and then cast to CRichEditCtrl* - but this seems to go against good COM practice? Can anybody recommend a COM friendly solution and restore my initial enthusiasm to program with COM!
Many Thanks
BarryM
|
|
|
|
|
Hi,
I eventually passed a long* ptr and casted back to CRichEditCtrl* in the COM method. Not nice but it seems to work. I hope to eventually discover the proper "COM" method of approaching this problem!
BM
|
|
|
|
|
I am trying to produce a library of objects relating to Drag and Drop. My library currently looks like this:
import "oaidl.idl";<br />
import "ocidl.idl";<br />
import "objidl.idl";<br />
[<br />
uuid(01020304-0506-0708-9010-011012013014)<br />
]<br />
library DragDrop{<br />
interface IDataObject;<br />
interface IEnumFORMATETC;<br />
interface IEnumSTATDATA;<br />
struct tagFORMATETC;<br />
struct tagDVTARGETDEVICE;<br />
struct tagSTGMEDIUM;<br />
struct tagSTATDATA;<br />
enum tagADVF;<br />
enum tagDATADIR;<br />
enum tagTYMED; <br />
};
However I have a problem. While I have found many of the interfaces and structures used by the IDataObject and it's proceeding object tree. I have been unable to find the STGMEDIUM object in any of my IDL import libraries. Do i need to include this in my library?
I have found a number of instances of STGMEDIUM object, but have not actualy found one that is the one I am looking for. there is remSTGMEDIUM, and uSTGMEDIUM. Which of these should I be using if any?
I would Have thought so if i want to compile it to a TLB.
Aditionaly, there are a number of structures and enumerations defined in the interfaces. Should I pull these out and implement them in the type library seperately? Or is this done automaticaly?
Is there anything else I am missing?
Thanks
Cata
|
|
|
|
|
hi Everbody
I know GUIDGEN.EXE with four select,but i don't know what meaning those are and how to use! I hope you tell me !
Thanks for your answer!
|
|
|
|
|
They are just different formats of typing the same thing.
MSDN Says:
The radio buttons in the GUID Format group box determine the format of the GUID the program will generate.
The first format is designed to be used in invocations of MFC's IMPLEMENT_OLECREATE macro.
The second format generates a reference to the DEFINE_GUID macro.
The remaining formats are appropriate for statically allocated GUID s and GUID s included in registry entries or registry editor scripts.
|
|
|
|
|
I'm trying to run midl, however, I am encountering error after error.
Cl.exe was not located in the correct location.
when i moved it, there was no mspdb70.dll to support CL.exe.
These components were all in different folders.
Is this right? Or is my instalation of .NET completely knackered?
Is it worth moving all the tools and associated DLL's into one directory? As it's really annoying.
I've copied all the stuff in the Vc7\bin folder to the common7\tools\bin folder.
I've moved the objidl.idl file into the tools\bin directory.
It's still not building objidl.idl. I get the error "Cannot open unkwn.idl"
help!
Cata
|
|
|
|