|
Humm,
maybe I didn't create it correctly, because I only declare the variable of my ActiveX, initialize everything...Normally, the mfc windows create the control itself, so I presume that my invisible windows trick should works Should I do it with CreateControl(); ? Maybe it's my IUSR_MYCOMPUTER that doesn't have the right to use it. I will give it a try...
Thanks
Guillaume Frechette
|
|
|
|
|
How do I invoke a Common File Open Dialog with MFC's CFileDialog class and have its initial folder view as the root of my shell namespace extension. I have created a shell namespace extension to browse dicuments on a remote computer, when I invoke CFileDialog::DoModal() I can browse to my shell namespace OK and select files OK, but I cannot set the initialDir to the root of my shell namespace.
Many Thanks
|
|
|
|
|
The answer comes from Michael Dunn, Thank you Michael
If the namespace is under My Computer, use a path of
::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{Your extension's GUID}
|
|
|
|
|
There are two things I can't find out how to do in VS .NET.
1) In VC 6.0, you could press F4 to go to the source point descibed by tool output. How do I do that in .NET? (And I do have found GotoNextTask, which doesn't work for find etc.)
2) How can I specify that the app should be linked statically with MFC?
|
|
|
|
|
Tools--->customize-->keyboard button:then you can choose your keyboard mapping to VC6
Anonymous3 wrote:
How can I specify that the app should be linked statically with MFC?
Project-->properties--->configuration properties---->General-->Use of MFC
When you create your project,you can set it too
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
I'm somewhat ashamed that I didn't saw the MFC setting, but the keyboard problem remains unsolved.
If I set keyboard mapping to VC6, F4 maps to View.NextTask. In .NET, only build messages are considered as a "task". I want to be able to use a keyboard shortcut to step forward in for example the find output or output from an external tool such as LINT.
|
|
|
|
|
Modify F4 to point to "Edit.GotoNextLocation"
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
|
hi guys,
i am using a derived class from the CDaoRecordset ( Table-type )class for my database. I tryed the following code and i got an assert. The assert is in the requery() function. I cant use the Requery() function i dont know why !!!
Please see code:
in my function
m_pSet = new CDaoTable;
m_pSet->Open();
m_pSet->AddNew();
m_pSet->m_Auto = "XXX";
m_pSet->Update();
m_pSet->m_strFilter = "Auto='XXX'";
// here i got the assert
m_pSet->Requery();
...
The assert is in the daocore.cpp line 3611 "ASSERT(CanRestart());
Best Regards
Sonu
|
|
|
|
|
I think it's because of your cursel type I don't remember now which one couldn't use Requery(),but you can check in MSDN
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
Hi,
I have inserted an ActiveX control in an automated session of Word in my App, but now I´m trying to get the dispatch pointer and it doesn´t work, I made:
Word::InlineShapePtr pShp = m_pWord->GetSelection()->InlineShapes->AddOLEObject(vClassType);
Word::OLEFormatPtr pFmt = pShp->OLEFormat;
IDispatch *pDispatch = pFmt->Object;
TRACE(pFmt->ClassType);
IGDIGraphics Control(pDispatch);
COleVariant x((long) 10, VT_I4);
COleVariant y((long) 10, VT_I4);
COleVariant title(TEXT("Method called from the App"));
Control.DrTextSimple(x, y, title);
(*) The IGDIGraphics is a wrapper class created by the Wizard of MFC...
The when I try to execute the method the program crashes, what I have made wrong ?, Thanks in advance
Braulio
|
|
|
|
|
Hola Braulio,
Maybe this totally misses the shot, but something caught my eye. I guess IGDIGraphics encapsulates a pointer to some COM interface called the same. If so, why are you providing a IDispatch * to the ctor of Control ? Shouldn't you obtain the proper pointer from pDispatch through QueryInterface ? Just a guess...
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hola Joaquin !
MMmm..., I think "pFmt->Object" returns and IDispatch, in theory the constructor of the wrapper class would accept that dispatch and then I could use that sugar class, but...
How could I do it in the hard way ( without wrapper classes), I would like to get the interface and then call "invoke" or get my interface, but I´m not used to COM and MFC
Thanks for your help, Bye !
Braulio
|
|
|
|
|
MMmm..., I think "pFmt->Object" returns and IDispatch, in theory the constructor of the wrapper class would accept that dispatch and then I could use that sugar class, but...
You can verify this by looking into the code for the wrapper. Some call to QueryInterface should be done inside to retrieve a proper pointer from the IDispatch * .
Also, assuming that the wrapper actually does the QueryInterface thing, can you verify that the pointer obtained is not null? Maybe what you're passing does not implement IGDIGraphic after all.
How could I do it in the hard way ( without wrapper classes), I would like to get the interface and then call "invoke" or get my interface, but I´m not used to COM and MFC
For doing that you must obtain first the GUID for the interface. With this piece of info, the rest is simple following the documentation on QueryInterface (call pFmt->Object->QueryInterface(...) ).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hola !
Finally the problem was using the class generated by the MFC wizard, I change to smart pointers, and it worked perfect ( and Smart pointers are pretty cool as well, it looks like VBasic code !).
Thanks Joaquin !, Bye !
Braulio
|
|
|
|
|
Congratulations! Good luck with your OLE odissey.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Can you you have more than one "throw" statements with the same parameters for a single try, throw catch execution.
Ex.
try {
Function()
}
catch ( CString s ) {
AfxMessageBox(s);
return FALSE;
}
Function() {
//some coding
if() {
CString dum = Error in this file;
throw dum;
}
//some more code
if () {
CString mud = SUCCESS;
throw SUCCESS;
}
}
|
|
|
|
|
Yes you can. From the point of view of the local flow within the function, each throw behaves as a return .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Just an FYI. Throws should never be used as part of normal program flow. The overhead is massive.
Exceptions (i.e. throws) should only be used for that, exceptions to normal program flow.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
ShowWindow (hWnd, SW_MINIMIZE) doesn't work in this case and
neither does WM_SYSCOMMAND with wParam = SC_MINIMIZE.
There's no counterpart to WM_MDIMAXIMIZE and I want all the child windows minimized by one command in the menu. Any idea?
|
|
|
|
|
Iterate truough the children window of the frame with EnumChildWindows and call CWnd::ShowWindow(SW_MINIMIZE) on each of them.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Windows weren't minimized in MDI fashion, that is as small bars with icon, text, close and minimize, maximize buttons.
Instead it was only one small bar in the lower left corner of MDI frame window - for all childs !
|
|
|
|
|
Yep, I've reproduced the behavior you describe. Try putting the command handler in your CMainFrame and passing m_hWndMDIClient as the hwnd parameter or EnumChildWindows (I've just done it and it works, though a little slowly).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I am new to all this and have made a text editor ( one of the most easy things
to start with ) but i want it to save an encrypted file that no other text
editor could read, so when you click save it asks for a password the saves
the encrypted text then when someone tries to load it they have to enter
the password??
Thanks in advance Steven Richardson!
P.S. i have Borland C++ Builder 5
|
|
|
|
|
How long is a piece of string? A really easy way to do it is just to take the raw text and XOR each byte with a constant byte value. That turns the text into garbage. Then you check the password. If it matches you XOR each byte of the garbage with the same constant byte and voila your original text is back.
Example:
Encryption - 101 xor 011 = 110
Decryption - 110 xor 011 = 101
This is really insecure but it's dead easy. It depends on what level of security you need. If you're just looking for something to stop casual observers then this will do the trick but if you expect someone to expend some effort in cracking your encrypted text and it's security is important then you need to look for something more significant than this.
There are plenty of industrial strength algorithms about but I'm no expert on current practices. Just google for 'encryption' for details.
The other potential problem with what you propose is that your security model is trivially broken if the password is revealed. Look for 'public key encryption' to avoid this.
HTH
i1.2sqrt(u).bcos(ur)sec(c)
but
b4.isqrt(u).ru/16
Navier
|
|
|
|