|
The site is working fine for me.
John
|
|
|
|
|
I need a sample using UDP Socket ..
Do you have ? Do you Know when can I found ?
Tks
|
|
|
|
|
Search Google for "UDP client" and you'll get many topics about programming with UDP sockets!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C# and C++!
|
|
|
|
|
Fellow Elites:
I use MFC created a explorer style SDI, leftside is CLeftView and I add a TreeView to it. On the right hand side I got CHtmlView.
So the problem is that when I double click on one of the Tree Item, the right hand side should load a new HTML Page, using Naviagte2 or LoadFromResouce to do it.
So can any one tell me how to do that?
Pelase
Thanks in Advance.
Andy.
|
|
|
|
|
I want to create a struct like this:
typedef struct tagSomeStruct
{
unsigned char * basePointer;
char __based(basePointer) * aBasedStringPointer;
}
SomeStruct;
I KNOW that this will not compile (basePointer must be defined outside the struct).
But if anybody knows a trick to base a pointer in a struct on another pointer in the same struct, then, pretty please, share your knowledge.
For the curious: I'm toying with a tool to serialize C collections, and it is crucial for the reusability that the basepointer can be defined dynamically.
"It could have been worse, it could have been ME!"
|
|
|
|
|
Are you using C?
I am not sure that I understand your question, but can you accomplish this by adding a constructor to your struct if you are using C++?
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Yes I am using C, but maybe I should switch to C++ for this task then.
You say that a constructor would solve this, but the problem is that I can't define a pointer to be based on a member in the same struct/class, I don't see how a constructor can help here?.
"It could have been worse, it could have been ME!"
|
|
|
|
|
I have a program that keeps getting a user breakpoint in ntdll. The program works perfectly, it's just this breakpoint is very irritating. Is there any to disable these breakpoints?
|
|
|
|
|
ed welch wrote:
The program works perfectly
Are you absolutely sure? What stack looks like when you hit that breakpoint?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
These user breakpoints in NTDLL are usually as a result of problems with your application. Check the output window; you may be corrupting memory in some way (double deletions, etc.)
John
|
|
|
|
|
Hello
I'm kinda newbie in C++ and I'd like to display 2 bitmaps at the same position, or clearlier, one above another.
I loaded the bitmaps in the resources (I'm using VC++ 6.0) and I then had their IDs.
I added a picture control and used the classwizard to get a CStatic variable associated to the picture control (it's actually a CStatic one)
Now I try to display these bitmaps in function of the resolution so I must use SetWindowPos to set properly the size, the position and the Z-order (the depth).
The problem comes from the fact that however I try, it's always the wrong BMP that is over the other, hiding it.
If anyone could help me, it would be very nice
|
|
|
|
|
Are you sure that you are using SetWindowPos properly to set the ZOrder of your static controls?
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Actually I've done a lot of combinations :
first.SetWindowPos(&wndTop,...);
second.SetWindowPos(&wndTop,...);
or with the SWP_NOZORDER flagat the end
I also tried to initialise in a different way which is first set the second then the first and it was the same result.
I finally tried to change the tab order and it worked !!!
But what I'm trying is to do the same with the CxSkinButton furnished here, on this site and it does not work as well as I wanted (By the way it is a great code)
sorry I do not have time to explain more in details, I will continue tomorrow...
.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:..:.:.:.:.:.:.:.:..:.:.
Should computing stay as a source of benefit or become like knowledge : free and opened to every one ?...
|
|
|
|
|
I am not usre what wndTop is in your example, but what you would do is call SetWindowPos on the static control that you want to be placed on top, and you would place the handle of the bottom control in the hwndAFter parameter of the function.
You will only need to call this function once to set the order that you are interested in.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Here a little quotation of MSDN doc about CWnd::SetWindowPos, the function I'm using (here you've got the description of the first parameter)
pWndInsertAfter
Identifies the CWnd object that will precede this CWnd object in the Z-order. This parameter can be a pointer to a CWnd or a Pointer to one of the following values:
- wndBottom Places the window at the bottom of the Z-order. If this CWnd is a topmost window, the window loses its topmost status; the system places the window at the bottom of all other windows.
- wndTop Places the window at the top of the Z-order.
- wndTopMost Places the window above all nontopmost windows. The window maintains its topmost position even when it is deactivated.
- wndNoTopMost Repositions the window to the top of all nontopmost windows (that is, behind all topmost windows). This flag has no effect if the window is already a nontopmost window.
As you can see I'm actually using the predefined variable. I tried with other variable such as the Picture controls that should be under others : It works well (for example I used : upper.SetWindowPos(lower,...) where upper and lower are 2 Picture controls). But what is wrong is when I use this class : CxSkinButton. This class is a marvelous Button which can have any shape and any bitmap over. It reacts to the mouse over event and change bitmap when it occurs.
So what's interesting here, is that the buttons are hidden behind a bitmap that should normally be shown behind them at the beginning. And when I go over where they should appear with the mouse, then they appear with the 'MouseOver' bitmap. After I leave the sensitive zone, the button remains visible with proper bitmap and is working as it should work.
So, actually my problem is that when I start the application, I must move the mouse over each button so that it can appear =>
I hope I've explain not so bad because it's a bit confusing...
Thank you in advance.
Joel
.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:..:.:.:.:.:.:.:.:..:.:.:.:.:.:.:.:.:.
Should computing stay as a source of benefit or become
like knowledge : free and opened to every one ?...
':':':':':':':':':':':':':':':':':':':':':':':':':':':':':':':':':':':':':':':':':':'
|
|
|
|
|
BTW, TAb order and Z-order are the same thing. Tab order is just how it is referred to in the dialog editor.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Right now I am using VB to test out my ATL components.
I simply add a project reference to my COM dll.
Then I do this :-
dim abc as blah.blah
retval=abc.func(args...)
That's all.
I am wondering whether there are any easy ways of testing my ATL component from VC++ itself?
I have some vague memories of someone using #import and then some QueryInterface() stuff!
More info and pointers are appreciated
Thanks
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
getting the smart pointers
#import [dllName] no_namespace
call
CoInitialize(NULL)
in your InitInstance and
CoUninitialize()
in your ExitInstance
and then
try{
_blahPtr abc(__uuidof(bla));
abc->func(args);
}
catch(_com_error err)
{
}
to test your com object
the addref etc.. is handled by the smart pointer
maybe you need to compile twice so the tlb file is generated
Regards
Rutger
|
|
|
|
|
Something's wrong Rutger
Am I supposed to link with something???
CoInitialize(NULL);
SimplePgp *p(__uuidof(SimplePgp));
CoUninitialize();
It refuses to compile
error C2059: syntax error : '__uuidof'
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Nish - Native CPian wrote:
SimplePgp *p(__uuidof(SimplePgp));
SimplePgpPtr p(__uuidof(SimplePgp));
Rama Krishna
When I am near don not fear.
|
|
|
|
|
Rama Krishna wrote:
SimplePgpPtr p(__uuidof(SimplePgp));
Fat lot of good that did!!!!!!!!
error C2065: 'SimplePgpPtr' : undeclared identifier
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
#import [dllname] no_namespace
or
prefix the SimplePgpPtr with the namespace declaration. Look at the generated [dllname].tlh and [dllname].tli to find out what the name of the namespace is. It would be same as the typelib name you gave to your COM server.
|
|
|
|
|
I did that and found that this now compiles :-
CoInitialize(NULL);
ISimplePgpPtr p(__uuidof(ISimplePgp)); <-- Run Time ERROR
//p->EncryptFile("d:\\in.txt","d:\a90.pgp","test@test.com");
CoUninitialize();
But program crashes at the above show line
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Nish - Native CPian wrote:
ISimplePgpPtr p(__uuidof(ISimplePgp));
ISimplePgpPtr p(__uuidof(SimplePgp));
|
|
|
|
|
Nish - Native CPian wrote:
CoInitialize(NULL);
SimplePgp *p(__uuidof(SimplePgp));
CoUninitialize();
It refuses to compile
error C2059: syntax error : '__uuidof'
Hello Nish,
Are you compiling it as a c++ file ? __uuidof() is both Microsoft & C++ specific so if it's in a .c file you might get this error. Also why are you using SimplePgp instead of _SimplePgpPtr (that's the generated smart pointer) and write _SimplePgpPtr p(__uuidof(SimplePgp).
you will still have to call the properties with -> but you can also access the smartpointers own methods trough the . operator.
Hope this works. the __uuidof turns blue in my vc 6.0 env so it's a recognised keyword.
Regards
Rutger
|
|
|
|