|
You make sure you have included all the headers you needed in c file and any libraries if needed.
Also, all the files you have created are added to your project.
And check if the path of included headers are correct.
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
I don't get any errors about libraries or headers that aren't found. So I think the pathes are correct.
|
|
|
|
|
Hi
Without being funny, you have to do something all of us do most of the time, It's called debugging. You wrote the code, You know what's in it.
And you Need to know what's in it!!
As a Hint, it seems your linker missed a lib.
Find out which one, and write:
#pragma comment(lib,"MyMissing.Lib");
Bram van Kampen
|
|
|
|
|
I already tried debugging the project, but I just got the message that something is wrong with the linker.
|
|
|
|
|
Well,
The functions yywclex(??) and yywcparse(??) have been declared, are being used in the stated modules, but have not been defined. That's why the linker cannot find them. Do a text search for these functions. If you cannot find a definition for them there may be something wrong with your generator. an other possibility is that you were supposed to write those yourself. Check the documentation for YACC. Thirdly, Is there a bug in your rules script, which results in YACC not generating those functions.
It is unlikely that there is something wrong with your linker. Also, because the code is in 'C', errors in type declarations may cause a run time issue, but will not be found by the linker. The functions:
'int f(int)' and 'int f(char,char) are both mangled to '_f' by the compiler.
Hope this helps
Bram van Kampen
|
|
|
|
|
I solved this problem by rebuilding all the library files which are included.
Now there's just one erroe left, but I don't thnk that this one has something to do with VC++, but with the lexer and parser generator I'm using.
|
|
|
|
|
Well, at least you're getting a handle on things. Gives a good feeling though, doesn't it.
Regards,
Bram van Kampen
|
|
|
|
|
I have a structure:
typedef struct{
unsigned short Id : 8;
unsigned short Name: 8;
unsigned short Length: 11;
unsigned short Value: 5;
} MyStruct;
I also have an array of bytes (unsigned char):
I want to stick that structure into the first four bytes in the array.
Array[0] = MyStruct->Id;
Array[1] = MyStruct->Name;
...then what?
How can I divide the last two values and put them into the [2] and [3] position in the byte array?
|
|
|
|
|
|
Please note sizes are identical. Methods
(1) quick & dirty: copy memory
MyStruct m;
unsigned char a[4];
memcpy(a, &m, sizeof(a));
(2) perhaps more elegant: use union
typedef union
{
MyStruct m;
unsigned char a[4];
}MyUnion;
MyUnion mu;
unsigned char array[4];
for (i=0; i<4; i++)
{
array[i]=mu.a[i];
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
It looks like the memcpy might work. I didn't really want to go the route of using a Union.
I was actually looking for a method to do this using bit shifting.
Something like...
unsigned char NewChar = MyStruct->Length << 8;
which would put the 8 leftmost bits in Length into the NewChar, which you could put into Array[2];
but then, how do I get the other three bits from Length and merge them with the 5 bits from MyStruct->Value?
I kind of know what I want to do it, but I don't know exactly how, what commands to use or what I'm doing.
|
|
|
|
|
Just for the academy (since memcpy is more concise and probably faster).
MyStruct m;
unsigned char a[4];
a[2] = (unsigned char) m.Length;
a[3] = (m.Length >> 8) | (m.Value << 3);
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Cool.
That's what I was looking for originally. But the memcpy works.
THANKS!
|
|
|
|
|
|
"how to set background color ?"
Hi ,
U can handle WM_CTLCOLORDLG to change the background color of the dialog.
In the link u have given, the code is not returning the handle to the new bursh u want to set for the dialog. See what msdn says
"OnCtlColor must return a handle to the brush that is to be used for painting the control background".
In the code u r returning the default brush handle. so that may the problem of not changineg the background color.
and change your code like this
<br />
if(nCtlColor == CTLCOLOR_DLG)<br />
{<br />
hbr = CreateSolidBrush(RGB(2,22,222));<br />
}<br />
thanks
Nitheesh
modified on Friday, April 11, 2008 10:58 AM
|
|
|
|
|
Dear Nitheesh,
I am still not able to change the background color after I tried the code below. As I'm a beginner of c++, would you please point out the deficit or improper use of code. Thank you very much!
HBRUSH CMyAppView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CScrollView::OnCtlColor(pDC, pWnd, nCtlColor);
if(nCtlColor == CTLCOLOR_DLG)
{
hbr = CreateSolidBrush(RGB(2,22,222));
}
return hbr;
}
Cheers,
john
|
|
|
|
|
You can use ofWM_CTL* for change color of buttons,dialog,static control and....
|
|
|
|
|
Hi All,
I am enumerating the network adapters by using the GetAdaptersInfo() API. But, I am not able to distinguish between the ethernet and wireless network as both the adapters are having the type as MIB_IF_TYPE_ETHERNET. Does anyone have an idea?
Thank you,
AJ
|
|
|
|
|
Looking at the documentation on MSDN GetAdaptersInfo( ) doesn't return that much detail and has been superseded by GetAdaptersAddresses[^] as of Windows XP, however even that only looks like it will differentiate between wired and wireless on Vista and not XP.
Gavin Taylor
|
|
|
|
|
Hi all,
I want to change default blue color of title bar for my SDI window.
I tried painting title bar area through OnNcPaint() but Icon, Caption,Buttons gets disappear, on mouse over buttons appear.
help me with some solution
thanks
|
|
|
|
|
SetSysColor<br />
GetSysColor
Hope it helps.
|
|
|
|
|
Yes it helps for system windows..
in my SDI appln,
CWnd* pWnd = CMainFrame::GetActiveWindow();
pWnd-> doesnt have setsyscolor or getsyscolor.
how could i get these functions to my CMainframe (constructor or create)
i NEED TO CHANGE ACTIVECAPTION/INACTIVECAPTION Colors.
thanks
|
|
|
|
|
It's a api function, just call ::GetSysColor /::SetSysColor .
Use parameters like:
COLOR_GRADIENTACTIVECAPTION<br />
COLOR_GRADIENTINACTIVECAPTION
|
|
|
|
|
AFAIK, if you handle OnNcPaint, you need to do everything (redraw everything )
(but I might be wrong).
|
|
|
|
|
u r right ..if i handle NCPAINT i got to redraw each and evrything in title bar on my own.
Instead iam looking for some solution from which i can change color of Title bar without disturbing caption text,icon,standard buttons.
|
|
|
|