|
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
|
|
|
|
|
Hi, I have following technical question. Maybe someone has the knowhow, so I wouldm´t have to worry about seeking further
I have a server, he receives from somewhare a port number. So I want to find out what process communicates wia this port.
More rigurous:
I would like to find a method about determining a Process ID knowing a port number of a connection opened by this process.
Any hint would be highly appreciated.
Thanx
Bla´bla
|
|
|
|
|
I don't know how it's done but Foundstone have a free tool called FPort (in the Intrusion Detection section) that will do it for you. As far as I'm concerned actually doing this is deep voodoo.
i1.2sqrt(u).bcos(ur)sec(c)
but
b4.isqrt(u).ru/16
Navier
|
|
|
|
|
I am trying to print an area of the screen (specifically the VIEW only). I have a Dialog bar on top. When I do a GetClient rect, I get the size of the VIEW. This is fine. However, I grab the DC of the screen which includes the bar. The screen coordinates has the right width and height dimensions but not the offset to take into account the bar which I don,t want. From my view how would I get the dimensions of the View RELATIVE to the entire screen? Any other way? I am putting this in a derived view which ALL my views derive from. Thus, I really do not want to make this specific for this app but instead a general solution without knowing if there is none, one or ... Dialog bars on top.
Thanks in advance.
|
|
|
|
|
Hi Stan, maybe <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_cwnd.3a3a.clienttoscreen.asp">CWnd::ClientToScreen</a> is the function you're looking for.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I wrote the codes:
#include <iostream.h>
void main()
{
int flag=0;
int i,j,k;
for(i=2;i>3;i++)
{
for(j=0;j>9;j++)
{
for(k=0;k>9;k++)
{
if(i+j+k==12&&i*j*k==42)
{flag=1;
cout<
|
|
|
|
|
sorry , I forgot the header
#include <iostream.h>
but the problem still in
|
|
|
|
|
Actually you didnt forget the header.
The < and > are taken as html tags.
Tick the no-html check box and re-post it.
Also put it as pre tagged.
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
Your linker error is not really anything to do with your code. i suspect that either cl.exe is missing, broken, or not in the PATH.
One observation of your code though,
for(i=2;i>3;i++)
means that your code actually won't run. every time execution meets the for statement, it evaluates your condition (i>3) and only continues if it is True.
On the first iteration, i=2. Therefore, i>3 is false, and it will skip the entire for {..} block.
Note that this is not the cause of your linker error, just a problem i noticed.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Jon Hulatt wrote:
One observation of your code though,
for(i=2;i>3;i++)
means that your code actually won't run. every time execution meets the for statement, it evaluates your condition (i>3) and only continues if it is True.
YES,you are right.
the right codes are that:
for(i=2;i<=3;i++);
I forgot that,thanks for your help.
|
|
|
|
|
Alpha_No1 wrote:
Error spawning cl.exe
What is the error code?
Regards....
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Here cl.exe is the MS 32-bit C/C++ compiler. The reason for the error may be that the path to this compiler has not been set. Go to Tools -> Options -> Directories in your VC IDE and check your paths to Executable Files.
The cl.exe file is normally in your bin directory.
Atul
Sonork 100.13714 netdiva
|
|
|
|