|
Hi, dear all,
I am using VB6. I am running a program created years ago. when I open a form, I got the following error:
Line 75: Property OleObjectBlob in dirDDBox could not be set.
Line 75: Cannot load control dirDDBox; license not found.
Line 83: Property OleObjectBlob in dirListBox could not be set.
Line 83: Cannot load control dirListBox; license not found.
Are dirDDBox and dirListBox shipped with VB6? or belong some other control that need register?
After I run VB6Cli.exe utility, still got the same error.
Can anybody help me. Thanks a lot.
|
|
|
|
|
Try asking at the Visual Basic Messageboard[^] instead, this is for C/C++/MFC.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Sorry, put in a wrong place.
|
|
|
|
|
No problems, happens to the best of us.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
|
|
I have seen a few posts which didn't share enough details about the subject to get a usefull answer but wow, hey, this one tops them all.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Or maybe this is some sort of Zen question from which you can create 10000 questions by knowing the real meaning of what t means.
|
|
|
|
|
Could be, i already have one of those 10000 questions in my mind: "What the hell does he mean by 't'?"
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
|
#include <iostream.h>
struct structA
{
int iMember;
char *cMember;
};
int main(int argc, char* argv[])
{
structA instant1,instant2;
char c = 'a';
instant1.iMember = 1;
instant1.cMember = &c;
instant2 = instant1;
cout << *(instant1.cMember) << endl;
*(instant2.cMember) = 'b';
cout << *(instant1.cMember) << endl;
getchar();
}
|
|
|
|
|
wbgxx wrote: char c = 'a';
-here you make c equal to 'a'
wbgxx wrote: instant1.cMember = &c;
-here you make the cMember pointer of instant1 point at the variable c, so instant1.cMember now contains the memory location of c
wbgxx wrote: instant2 = instant1;
-here you copy the contents of instant1 into instant2, so the members in instant2 (iMember, cMember) will contain the same values as the corresponding ones in instant1. This means, instant2.cMember now also points at your c variable, both instant1.cMember and instant2.cMember contains the memory address of the variable c.
wbgxx wrote: cout << *(instant1.cMember) << endl; -here you say "print out the value that is stored in the memory location pointed at by instant1.cMember", this memory location happens to be c's, and since you set c to 'a', it will print 'a'.
wbgxx wrote: *(instant2.cMember) = 'b'; - here you say, "copy the value 'b' to the memory location pointed at by instant2.cMember", which is -as you remember- the same as instant1.cMember, the address of your c variable.
wbgxx wrote: cout << *(instant1.cMember) << endl; - here you say now, "print out the value that is stored in the memory location pointed at by instant1.cMember" again, but since this memory location is the same as the one stored in instant2, and previously you changed the value stored in that memory location to 'b', it will print 'b'.
This is basic pointer stuff, i recommend reading some good books or checking out online tutorials about pointers in C/C++...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
When you do instant2 = instant1; it does a bitwise copy.
This means instant1 and instant2 will be exactly alike.
Which means the address pointed to by instant1.cMember and instant2.cMember will be the same.
And so changing the value using any of the pointers will reflect in both the pointers.
This is a classic example of why we need a copy constructor and assignment operator.
|
|
|
|
|
wbgxx wrote: cout << *(instant1.cMember) << endl; //I want to know why change instant2 and the instant1 change!
I want to know why you think instant2 has changed; all you did is look at instant1
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
#include <iostream>
using namespace std;
#pragma pack(8)
struct example1
{
short a;
long b;
};
struct example2
{
char c;
example1 struct1;
short e;
};
#pragma pack()
int main()
{
example2 struct2;
cout << sizeof(example1) << endl;
cout << sizeof(example2) << endl;
cout << (unsigned int)(&struct2.struct1) - (unsigned int)(&struct2)
<< endl;
getchar();
}
|
|
|
|
|
I am not sure what your problem is, but i will guess.
wbgxx wrote: cout << sizeof(example1) << endl; //8
- here you wonder why you get 8 instead of 6 when short is suposed to be 2 bytes and long is suposed to be 4 bytes, so 2+4 is 6, not 8.
wbgxx wrote: cout << sizeof(example2) << endl; //16
- here you wonder why you get 16 when char is 1 byte, short is 2 byte and your struct1 is 8 bytes so you expect it to be 11 bytes altogether, not 16.
wbgxx wrote: cout << (unsigned int)(&struct2.struct1) - (unsigned int)(&struct2)
<< endl; //4
- here you wonder why you get 4 bytes instead of 1 byte, since there's only a char infront of the struct2 member which is suposed to be 1 byte long, not 4.
If i am right then see this[^] and this[^].
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Code-o-mat has pointed in the right direction.
It has everything to do with the structure packing and the controlling #pragma pack directive.
In you're example it says #pragma pack(8) .
This means pack the struct on 8 byte boundaries.
For the structure example1 , short is 2 bytes and long is 4 bytes.
Here the compiler will reserve 4 bytes for the short so that it becomes 8 bytes total.
If you change the pragma to #pragma pack(1) , you should get the results as 6 and 9.
|
|
|
|
|
cout << (unsigned int)(&struct2.struct1) - (unsigned int)(&struct2)
<< endl;
and what is (unsigned int)(&struct2.struct1)means?
|
|
|
|
|
wbgxx wrote: (unsigned int)(&struct2.struct1
You first take the address of a variable... Then cast it to a number, so when cout "prints" it, it will be shown as a number, not some fancier thing.
As the answers to your (slightly) later question said, this is very basic C/C++ stuff - a book is better able to help you than a message board.
Pointers are one of that concepts that can explained for ages, but you'll wake up one morning and go "Oooooh!". Think of the difference between the place you live - and address written on a postcard to you.
Good luck with your journey.
Iain.
I have now moved to Sweden for love (awwww).
|
|
|
|
|
Windows explorer shows a tooltip if the contents of a column is not entirely visible. I'm trying to emulate that behaviour but when I move the tooltip to cover the clipped text I end up with a flashing tooltip. This seems to be because the tooltip is now under the cursor which causes it to be closed immediately which leaves the cursor back over the clipped text which fires the tooltip and around we go.
Has anyone run into this before and found a solution?
|
|
|
|
|
Just a guess but try adding the WS_EX_TRANSPARENT style to your tooltip and see if it changes anything, don't know what it might screw up though...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
I tried something like this, but no success:
SendMessage(WM_SYSKEYDOWN, VK_MENU,NULL);
Any ideas?
modified on Tuesday, May 11, 2010 10:32 AM
|
|
|
|
|
Don't know what exactly you wish to achieve, but could SendKeys[^] do the job?
[EDIT] Oups, that link should be keybd_event[^], not SendKeys...[/EDIT]
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
modified on Tuesday, May 11, 2010 11:57 AM
|
|
|
|
|
keybd_event worked for me. I just thought by doing SendMessage would do the same thing. Oh well...
|
|
|
|
|
Oups, i just noticed, i pasted the wrong link there in my post, in fact i meant keybd_event[^] too...sorry, but i guess you got it already.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|