|
Any more example? Why do we need two boolean logic data tpyes?
Does BOOL appear in C language?
|
|
|
|
|
Alex Ngai wrote:
Any more example? Why do we need two boolean logic data tpyes?
BOOL is a good choice for 32-bit applications
bool, naah, it works if you want to use it... but no...
Alex Ngai wrote:
Does BOOL appear in C language?
Just include windows.h and tada!
You can also define it yourself:
typedef int BOOL;
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
BOOL isn't standard C language no. It's defined in the Windows headers. It's used by Windows API functions to pass flags.
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
|
The header file that I have says its a plain int;
Thank You
Bo Hunter
|
|
|
|
|
Right.
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
There are no archive insertion/extraction operators defined in CArchive for "bool" so Serialization will not work.
Use bool as much as possible if u r not dealing with windows api.
while porting OS from 16 bit to 32 bit, sizeof "BOOL"( which is typedef of integer) also increased.If in future, while porting OS to 128 bit, size of BOOL(same as sizeof int) will b 16 bytes. R u going to tolerate this stupidity if u r not dealing with WinAPI?
If u r using more than one boolean variable in ur code, I 'll suggest u to use one bool with bitfields. This way u will accommodate upto 8 bool variables. I believe that MS Access stores boolean datatypes this way.
The chosen One
|
|
|
|
|
Well, I wonder if VS.Net support pure C language? Since there is no
C file that you can create when you open a new project in VS.Net.
|
|
|
|
|
Yes it does. Just rename the file to .c
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
By saying Pure C language, I mean C99, the latest ANSI/ISO standard
for C. Have you written a project that using only C, and does not
contain any code that is C++ stardand? And how is the result?
Is the result what you expected? Any strange error during compiling
and running?
|
|
|
|
|
I've written an app i pure C yes. I discovered that the declarations of varibles couldn't be done anywhere in the code and has to be declared in the beginning of the scope. I've read in my "C: The Complete Reference" that C99 supports declarations anywhere in the code.
http://duden.mine.nu/wr/Client/
That's the project I've made.
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Well, I have just read your project. I have a question reguarding to
that. In C++, it support OOP, so it is logically right to split files.
Header being class definition, and cpp being implementation and
driver.
However, C does not do OOP, so how do they split files? What do they
put in header file? Is it common to put everyting in a .c file? Well,
you did that for your WZ project.
P.S. I'm learning C++, but completely new to pure C.
Thanks
|
|
|
|
|
Yeah I did put everything in one .c file because it was just a test project and it had only a few hundreds lines of code. But yes, you do the same as in C++, put all your function declarations in one header file and globals and #defines and whatever you want and then implement it in your source file (.c or cpp).
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
At the moment, very few compilers support C99 - it's too new.
I believe that Microsoft is not intending to ever support C99 - they will only support C89 (as revised in 1995).
C99 adds a few features that frankly are only of use in building larger scale programs, and for that, there's C++.
IIRC, VC.NET (the environment) adds the /TP switch to your project settings, meaning that all files are compiled as C++ even if they have a .c extension. Turn this switch off if you want .c files compiled as C.
|
|
|
|
|
No, Visual C++ .NET 2002 does NOT support ISO/IEIC 9899:1999 C Language.
In MSDN of Visual Studio .NET 2002:
"Because the timing of the release of C99, this version of Visual C++ is not conformant with that standard."
You may try this sample code, which is of C99 code:
#include <stdio.h>
void main()
{
int v[10] = {v[0] = 3, v[5] = 5 };
int i;
for(i = 0; i < 10; i++)
{
printf("[%d +1] = %d \n", i, v[i]);
}
}
The result is wrong.
BuggyMax
|
|
|
|
|
Hi...
I'm not sure why the error - 'OnSelchangeLUCOMPTop' : local function definitions are illegal, comes out...how shd i ammend this...thanks.
void CComp::OnSelchangeLUCOMPTop()
{
UpdateData(TRUE);
Tselection1 = "Selection Changed";
CMain::uc_top = m_uc_ts.GetCurSel();
m_uc_epo.EnableWindow(TRUE);
m_uc_epp.EnableWindow(TRUE);
}
|
|
|
|
|
fynox wrote:
CMain::uc_top
That's illegal. I assume you somewhere have declared a pointer to the CMain class in your CComp class: CMain *pParent . For example declare in your header file: CMain *pParent and initialize it from your main class: CComp dlg; dlg.pParent = this; .
Then use this: pParent->uc_top = m_uc_ts.GetCurSel(); .
Hope that helps
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Sounds like you have failed to add a closing brace for a function preceeding this one in the same file.
void CComp::SomeFunction()
{
void CComp::OnSelchangeLUCOMPTop()
{
UpdateData(TRUE);
Tselection1 = "Selection Changed";
CMain::uc_top = m_uc_ts.GetCurSel();
m_uc_epo.EnableWindow(TRUE);
m_uc_epp.EnableWindow(TRUE);
}
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Hi there,
i have created a bitmap image and when i click on maximize or minimize button on the window it vanishes . what to be done for it . plz check it out and give the reply as early as possible .
Sreeram
|
|
|
|
|
Are you BitBlt the bitmap to the window DC? Probably you do so, and when you do so it will disappear when you repaint the client area which happen when you resize the window.
You'll need to paint the bitmap in your WM_PAINT handler.
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Guys,
I've a dialog based application which is a very large size application and i am working on it for about 8 months.
For the last two days i am having a trouble. The problem is that on my machine i compile it using Visual C++ 6.0 compiler and when i run the debug version, it runs normally.
Now if i take the debug exe to other machine and run it, i get the following system error:
The instruction at 0x00000000 referenced memory at 0x00000000. the memory could not be read.
Strange if i compile the program on second machine and run it, it works normally. But if i transfer the same exe to first machine, i get the same error.
For some testing i compile program on first machine and try to run the application in debugger of second machine. I placed a break point in the InitInstance() of Application class. But it is crashing before the control enters the InitInstance(). Can anyone tell me how to solve the problem.
Oh yes one more thing. In my workspace there are five projects. Four of them are statically linked with MFC and use Debug Multithreaded dll confguration. While one is not using MFC. I am just using debug builds.
|
|
|
|
|
Hi,
This crash is happening because of different versions of MFC runtime libraries u r using in debug mode. U can find this by using dependency walker.
To resolve the problem u r facing
1. Create setup which will port all dependencies of ur application to other machine.(not a good option)
2. As u have mentioned, Four of them are statically linked with MFC and use Debug Multithreaded dll confguration, use "debug Multithreaded" option.
This will solve ur problem.
The chosen One
|
|
|
|
|
Hi all,
I want to draw sound wave but I don't know how to get the sound data. For example, I have a sound which length is 100 frames and I want to get the sound data at each frame.
Thanks in advance,
Dang Xuan Ky
|
|
|
|
|
Hi everyone
I want to ask u how to move character on the screen in vc++. And also (speech)voice in vc++ AS like MSoffice assistant(Help).
If there is any answer,pl let me know.
Thanks
|
|
|
|
|
Could someone pleae explain the following typedef?
I know that I_TextOutput is an abstract interface and
that GETPLUGIN is a function that will be loaded from a dll.
typedef void (*GETPLUGIN)(I_TextOuput**);
Thanks,
Steve
|
|
|
|