|
Why are you posting a plain C question in a C++ / MFC forum?
That said, I think you should write
void _InitVector(_VECTOR* pVector)
instead of
void _InitVector(struct _VECTOR* pVector)
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
hi,
The joke is that because I think C is a subset of C++.
And I got problem with the absence of that 'struct':
[Error] parse error before '*'
It seems the pre-declaration can never be sighted by the compiler(mingw2.95).
|
|
|
|
|
6Qing88 wrote: And I got problem with the absence of that 'struct
Sorry I didn't read your post carefully. The problem is that you declare _VECTOR as a struct first
struct _VECTOR;
void _InitVector(struct _VECTOR* pVector);
but as a typedef later
typedef struct _tagVECTOR {
int a;
} _VECTOR, *_PVECTOR;
You can't forward declare a typedef as a struct, because it is not a struct - it is a typedef. I think it is intended to be that way (i.e. it's not the compiler but the C language specs that require it).
You can try writing this at the header (I haven't tested it)
struct _tagVECTOR;
typedef struct _tagVECTOR _VECTOR;
void _InitVector(_VECTOR * pVector);
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Your problem is that you're using struct _VECTOR in interface.h and _VECTOR == struct _tagVECTOR elsewhere. Those are two different types. It doesn't matter that you use _VECTOR in both - struct tag names are in a different namespace than type names.
Thus, in implementation.c , struct _VECTOR is incomplete. struct _tagVECTOR , aka _VECTOR is complete...but you are not referencing that type!
|
|
|
|
|
Hi all,
I am making look and feel of a Dialog same as message box can anybody tell me what font and size should i make it so that it should look exactly similar as messageBox.
Thanks
vikas da
|
|
|
|
|
You should use the MS Shell Dlg or MS Shell Dlg [^] logical fonts to have the same behavior of MS Windows dialogs. I am pretty sure that the default font size is 8 for most english users but if I remember correctly the default font size can be larger in an international installation.
Also keep in mind that although most users with 20-20 vision have the DPI set at 96, there may be individuals with DPI set at 120. You should test your messagebox dialog to ensure that it can handle all environments.
Best Wishes,
-David Delaune
|
|
|
|
|
guide me load data to combobox for vc++6.0. please. thanks
"
enum { IDD = IDD_SPOOLIMAGE_DS_PP };//gọi form
DDX_Control(pDX, IDC_TEST, value_del);
CComboBox* cb = (CComboBox*)GetDlgItem(IDC_TEST);
cb->Clear();
CString sName = "";
for(int i=0; i<10;i++)
{
cb->SetItemData(i, DWORD(i));
}
"
|
|
|
|
|
And what the problem?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
can you tell specification ? thanks . wish your help
|
|
|
|
|
If you want to add strings to Combobox you can use of:
for (int i = 0; i < m_nItems; i++)
{
m_pComboBox->InsertString(str);
}
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
why don't you use to AddString() to load data into the combo box?
|
|
|
|
|
I was Addstring() but wrong.
|
|
|
|
|
nguyen phan wrote: cb->SetItemData(i, DWORD(i));
SetItemData() is used to Set the 32-bit value associated with the specified item in a combo box. AddString() is used to add a string to the end of the list in the list box of a combo box.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
How to Invoke a Web Service using managed C++ OR VC++ .NET . provide me with some link
|
|
|
|
|
|
Did you see Web Services[^]?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
HI
how can i detect if a new ethernet cable is connected or disconnected dynamically?
can we use redundant ethernet cable so that it can takeover if the first one fails?
can we stop the communication through a port manually? i.e, enabling or disabling of a port?
Regards
pramod
|
|
|
|
|
hi experts plesae let me know how to obtain all DLLS information that depends on particular .exe file in 16 bit programs.Dependency walker is not working for 16-bit programs.iam working on vc++ 1.52...
kir_MFC
modified on Friday, January 9, 2009 1:40 AM
|
|
|
|
|
|
Use the EnumProcessModules API.
Use the GetCurrentProcess API to get the handle to the current process or OpenProcess to open an already running process.
If you want to get the dependent DLLs of an EXE that is not running, you will need to parse the EXEs internal PE structure.
PEDump is one such program.
«_Superman_»
|
|
|
|
|
Hi,
I'm loading resource>toolbar into CImageList
When i draw using imageList.draw, then the transparent is no more work
any idea?
CImageList ImgList;
COLORREF rgbTransparentColor = RGB(73,73,73);//dono what this use..
CBitmap bmp;
int bubu = bmp.LoadBitmapW(IDR_MAINFRAME);//the toolbar to be loaded
ImgList.Create(16.5,14.5,ILC_MASK | ILC_COLOR32,1,1);
ImgList.Add(&bmp, rgbTransparentColor);//put the bitmap into imagelist
CPoint ptImage(rectIcon.left + 1, rectIcon.top + 1);//get the point(position) of the rectangle to be drawn
ImgList.Draw(pDC, nIconPosi, ptImage, ILD_NORMAL);//draw the icon
good
|
|
|
|
|
karhong wrote: RGB(73,73,73);//
Is this the color in the bitmap that you want to make transperent?
|
|
|
|
|
yea.. i hope to make the imgList.Draw icons to have the background color of RGB(73,73,73)
good
|
|
|
|
|
Either I am misunderstanding you, or you are misunderstanding the API.
The transparent colour is the colour in the original bitmap that you want to become transparent.
I normally use a hideous shade of purple, or pink. I'm too manly to use them for actual display. There is nothing stopping you using a certain shade of gray (RGB(73,73,73)), but it will be less obvious when you are editing the original bitmap.
For debugging the sort of problem you have, I strongly recommend the excellent article http://www.codeproject.com/KB/applications/imageviewer.aspx[^] by PJ Arends.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Hi all,
We have a situation where we need to check that the 'this' pointer is not null in a (non-virtual) member function. The problem is that the class it is in is sometimes involved in a multiple inheritance hierarchy where it is not the first base class and thus the 'this' pointer is adjusted by the compiler before it is given to our function. I've read that "some" compilers will explicitly check for null "this" pointers and not adjust them to prevent this issue; however, it does not seem that MSVC++ 9 behaves this way. Is there by any chance a flag that can be set to enable this behavior?
If there is not, what suggestions do you have on a way of reliably detecting this situation? One thought is to simply compare vs a sufficiently large value such that any offsets would be well within the range - perhaps the system reserved memory range (0 - 0x0000 FFFF). Any others are welcome. Thanks in advance.
|
|
|
|