excerpt from lecture notes help
hey all,
http://www.difranco.net/cop2334/Outlines/fileproc.htm
there's a section called:
Writing Data Randomly to a Random-access File
can you make it write plain text to the text file and still make all the
random stuff work? what do you need to changed to make it write as plain text
instead of binary?
thanks,
rodchar Tag: MMX registers Tag: 279275
Structure size
I would like to allocate a structure size of 1024 bytes but I want the
compiler to do the calculation for me.
typedef struct
{
int var1;
short var2;
long var3;
char var4[ ?????? ];
} MYSTRUCT;
What I want to do is replace the ?????? something that will automattically
make the total structure 1024 bytes without having to manually count the
bytes of the other members myself.
Is that possible in vc++?
Thanks. Tag: MMX registers Tag: 279273
Basic terminology help
hey all,
what's the difference between an API and a library of functions such as MFC?
Are these terms synonomous?
thanks,
rodchar Tag: MMX registers Tag: 279266
Petzold's tome
hey all,
i started my reading of Programming Windows and have a newbie question about
the following excerpt:
Microsoft Windows version 3.1 was released in April 1992. Several
significant features included the TrueType font technology (which brought
scaleable outline fonts to Windows), multimedia (sound and music), Object
Linking and Embedding (OLE), and standardized common dialog boxes. Windows
3.1 ran only in protected mode and required a 286 or 386 processor with at
least 1 MB of memory.
The last sentence is my question what does that mean in lamen's terms to run
in protected mode?
thanks,
rodchar Tag: MMX registers Tag: 279259
Managed C++ changing a forms property (Text)
Hey,
I'm working more with C++ nowadays (Creating host managers for a game,
and i need the asm functionality to get it all working.
I am trying to do (from frmAttach), changing the Text property of
frmMain ---- i am from VB, so i have tried frmMain.Text, frmMain().Text,
frmMain::Text, etc.
How would i achieve this?
Cheers Tag: MMX registers Tag: 279254
get the idle time of an excel application
I need to get the idle time of an excel application that is opened
through VC++.
Once the excel is opened there should be a timer that starts and it
should re start when ever there is some activity in the excel and if
the excel is ideal for about 15 mins then there should be a pop up
message Tag: MMX registers Tag: 279244
Compiler optimization problem in MSVC 2003 Release mode
Hi,
I have written a small function to check whether a single precision
variable is sufficient to hold a double precision value. The code is
below
#include <stdio.h>
int cmpFloat_to_Double(float x, double y) { return x == y;}
#define IsSinglePrecisionSufficient(a) cmpFloat_to_Double((float)a, a)
void main( void )
{
double b = 0.7;
printf("%d",IsSinglePrecisionSufficient(b));
}
It works fine in debug mode giving output of 0 but in release it gives
1. Also if i change
int cmpFloat_to_Double(float x, double y) { return x == y;}
to
int cmpFloat_to_Double(volatile float x, volatile double y) { return x
== y;}
it works fine in release mode too.
Thanks
Shireesh Tag: MMX registers Tag: 279235
How to include a header file in another header file that....
Hello, I have a global header file called TypeDefs.H, this file is included
in header file of every class of my project. because all classes use custom
types. Now I have a class called CMyData which is also a member of some
structs in TypeDefs.H, so I have to include MyData.H in TypeDefs.H
problem is some members of CMyData are custom and defined in TypeDefs.H so I
also have to include TypeDefs.H in MyData.H
I agree that it may seem ugly but in this way I can keep things organized in
my brain, but compiler dose not like that and shouts loudly with thousands of
error messages. I even tried
to use
<code>
#ifndef MY_DATA_H_
#define MY_DATA_H_
...
#endif
</code>
in MyData.H
and
<code>
#ifndef TYPE_DEFS_H_
#define TYPE_DEFS_H_
...
#endif
</code>
in TypeDefs.H
but problem persists
can someone kindly tell me how can I get over this problem:) Tag: MMX registers Tag: 279231
Self Extracting Exe (how?)
Hello All,
I want to create a self-extracting executable to bind several files.
I have been looking at using custom resources to hold the desired files then
re-create the files from the resources. However, I ran into a problem. I've
been using
HGLOBAL hResource = LoadResource(hInst, FindResource(hinst,...,...));
LPVOID pData = LockResource(hResource);
/// Use data...
FreeResource();
Using this method, I have not been able to find the size of the memory
allocated. Without the size, I'm not able to know where each file ends.
GlobalSize() can not be used. Does anyone have any suggestions or different
approaches?
Thank you,
M Tag: MMX registers Tag: 279216
help with this article please
hey all,
can somone please try to open the source code in the following article in
VC++. Apparently the author used some other editor and when I try to open it
up I get a compile error.
http://www.codeproject.com/win32/Win32SDK_C_TabCtrl.asp
thanks,
rodchar Tag: MMX registers Tag: 279214
Function Identifier Not Found Error
Hi,
I was trying to compile some code and I am getting a "Function
identifier not found" error. I can't figure out why since the
function that it claims is not identified is very clearly laid out.
Here is the declaration in my h file:
#pragma once
#include "afxwin.h"
class CGUIDlg : public CDialog
{
// Construction
...
// Implementation
protected:
..
public:
BOOL processEventMsg(time_t TimeSec, UCHAR chan, int strtID, UCHAR
*buf, int siz);
...
...
};
My function is written in the code as:
BOOL CGUIDlg::processEventMsg(time_t TimeSec, UCHAR chan, int strtID,
UCHAR *buf, int siz)
{
...
}
And it is called in another function as:
void getAllRs232( int lr )
{
...
processEventMsg(TimeSec, (UCHAR)(lr+8),elmThree*32, adrs, length-1); //
These variables have been declared and used
...
}
However upon compilation the error states that processEventMsg
identifier is not found. I've tried moving around the function to
different area of the code but it gives the same error.
Does anyone have any ideas about what could cause this?
Thanks very much in advance for any help! Tag: MMX registers Tag: 279212
marquee in a dialog
hey all,
how hard would it be to put a simple marquee in a dialog box. The marquee
can be anything scrolling across the dialog such as plain text, hyperlinks,
and images.
any hints, articles, direction?
thanks,
rodchar Tag: MMX registers Tag: 279211
Function Identifier Not Found
Hi,
I was trying to compile some code and I am getting a "Function
identifier not found" error. I can't figure out why since the
function that it claims is not identified is very clearly laid out.
Here is the declaration in my h file:
#pragma once
#include "afxwin.h"
class CGUIDlg : public CDialog
{
// Construction
...
// Implementation
protected:
..
public:
BOOL processEventMsg(time_t TimeSec, UCHAR chan, int strtID, UCHAR
*buf, int siz);
...
...
};
My function is written in the code as:
BOOL CGUIDlg::processEventMsg(time_t TimeSec, UCHAR chan, int strtID,
UCHAR *buf, int siz)
{
...
}
And it is called in another function as:
void getAllRs232( int lr )
{
...
processEventMsg(TimeSec, (UCHAR)(lr+8),elmThree*32, adrs, length-1); //
These variables have been declared and used
...
}
However upon compilation the error states that processEventMsg
identifier is not found. I've tried moving around the function to
different area of the code but it gives the same error.
Does anyone have any ideas about what could cause this?
Thanks very much in advance for any help! Tag: MMX registers Tag: 279209
Function identifier not found
Hi,
I was trying to compile some code and I am getting a "Function
identifier not found" error. I can't figure out why since the
function that it claims is not identified is very clearly laid out.
Here is the declaration in my h file:
#pragma once
#include "afxwin.h"
class CGUIDlg : public CDialog
{
// Construction
...
// Implementation
protected:
..
public:
BOOL processEventMsg(time_t TimeSec, UCHAR chan, int strtID, UCHAR
*buf, int siz);
...
...
};
My function is written in the code as:
BOOL CGUIDlg::processEventMsg(time_t TimeSec, UCHAR chan, int strtID,
UCHAR *buf, int siz)
{
...
}
And it is called in another function as:
void getAllRs232( int lr )
{
...
processEventMsg(TimeSec, (UCHAR)(lr+8),elmThree*32, adrs, length-1); //
These variables have been declared and used
...
}
However upon compilation the error states that processEventMsg
identifier is not found. I've tried moving around the function to
different area of the code but it gives the same error.
Does anyone have any ideas about what could cause this?
Thanks very much in advance for any help! Tag: MMX registers Tag: 279208
std::vector subscript out of range
Hello,
I really think I have to get a C++ book.... but let me ask one more question
Code Snippet
struct
{
std::string name;
...
} FRUIT, *PFRUIT;
struct
{
std::vector<FRUIT> fruitarr;
} fruittab;
std::string a;
fruittab.fruitarr[i].name = a;
the variable of i is 0 when called, but it returns vector subscript out of
range error Tag: MMX registers Tag: 279194
Question about TCHAR string
Hi,
I've been spoiled with C# and the easy to use string functions. Now I'm into
a bit of C++ for writing a custom action for a DLL to be incorporated into an
MSI installer. Yikes.
What I'm basically doing is getting the Product Key from the
MsiGetProperty() function, like this -
TCHAR szPidKey[MAX_PATH];
DWORD dwPath;
dwPath = sizeof(szPidKey) / sizeof(TCHAR);
MsiGetProperty(hInstall, TEXT("PIDKEY"), szPidKey, &dwPath);
So I have my Product ID in szPidKey. Now I want to do some manual
verification of it. The Product ID is of the form -
123456789-ABCD-12
I need to verify this code so I need access to the beginning part
(123456789) and the end part (12). So I'm looking for a way to substring out
those parts of the string. I'm also looking to convert those substrings into
integer or long data type so i can do some checking on them, is it ok to use
itoa to do that?
Thanks very much for any hints.
David Tag: MMX registers Tag: 279190
How to turn vector to an address
Hi,
Here is the code snippet, don't mind its correctness, just take it as an
example
struct
{
...
} FRUIT, *PFRUIT;
struct
{
std::vector<FRUIT> fruitarr;
};
============================
I have an address comparison...
pos = a - fruitarr; (a is PFRUIT, b4 modification fruitarr was also of type
PFRUIT)
============================
And the subtraction worked very well until I changed that line to
std::vector
The statement pos = a - fruitarr; did not work any more (compile-time error)
My question is how do I get the address from the vector<FRUIT> object?
Thanks
Jack Tag: MMX registers Tag: 279181
CloseHandle and WriteFile
Hi there!
I create a file using CreateFile(...), and write some data to the file
handle ,say hFile, using WriteFile(...) I wonder if I call CloseHandle
(hFile) to the handle, at the same time , WriteFile is operating on the file
handle , whether the WriteFile will block the CloseHandle? Tag: MMX registers Tag: 279172
How to make SetCursor work
I would like to set an hourglass cursor.
I say:
SetCursor(LoadCursor(NULL, IDC_WAIT))
for setting the hourglass cursor
and:
SetCursor(LoadCursor(NULL, IDC_ARROW))
for going back to the regular cursor.
But neither cursor gets set?
Please help! Thanks! Tag: MMX registers Tag: 279155
is there another way to get edit box
hey all,
i found this snippet in tutorial which show how to retrieve a value from an
edit box just using win32api, is there another way to get this thru just the
api?
// TODO: Read an edit box
int len;
len = GetWindowTextLength(m_hFirstNameEdit);
if (len>0) {
char* buf;
buf = (char *)GlobalAlloc(GPTR, len+1);
GetDlgItemText(m_hWnd, IDE_FIRSTNAME, buf, len + 1);
// .... work witht the text
MessageBox(m_hWnd, buf,"Hello",
MB_OK | MB_ICONEXCLAMATION);
GlobalFree((HANDLE)buf);
}
thanks,
rodchar Tag: MMX registers Tag: 279150
Dialogbox question
If I use dialogbox() function to specify a dialogbox (template already in
resource), is there any way for me to specify the dialogbox window size?
(since I don't have access to the actual CreateWindow but the dialogbox()
function helped did so, so I want to know whether it's possible to specify
those sizes manually for the dialogbox in code but not create a window
manually.) Tag: MMX registers Tag: 279140
snippet of code
hey all,
does this snippet of code indicate any presence of MFC or Microsoft Libraries:
//Populate ComboBox
FillListBox(hwndList);
//Set a Default Selection
SendMessage(hwndList, CB_SETCURSEL, 0, 0);
GetWindowText(hwndList, pVarName, 30);
SetWindowText(hwndText, pVarName);
return 0;
I'm particularly interested in the GET/SET WindowText functions. How would I
be able to tell?
thanks,
rodchar Tag: MMX registers Tag: 279133
history lesson
hey all,
with the start of my c++ journey i see substitutions like LPSTR for char*
for instantance. can someone please brief me on why this is and if possible a
list of common substitutions?
thanks,
rodchar Tag: MMX registers Tag: 279131
SplashButton question
Hi,
I have a splashbutton, in there I am using AddMessage method to add
message on the fly. Actually I show the progress. I ran into a
problem. First I show a number say 10% on the second round, I want to
change the text to 20%. So I first write " " (blank characters)
and then write the new number. So users get the feeling the progress
is happening. But When I tried, the blank characters are not writing
and the text is over writing itself. Could some one help? Here is the
code I am trying to do it.
AddMessage(" ", SLIDE_TEXT_FONT,
SLIDE_TEXT_FROM_BOTTOM,
0, SLIDE_TEXT_FROM_RIGHT,
FW_NORMAL, FALSE, FALSE, TA_CENTER,
DT_CENTER|DT_BOTTOM|DT_SINGLELINE,
SLIDE_COLOR);
AddMessage(m_csSlideText, SLIDE_TEXT_FONT,
SLIDE_TEXT_FROM_BOTTOM,
0, SLIDE_TEXT_FROM_RIGHT,
FW_NORMAL, FALSE, FALSE, TA_CENTER,
DT_CENTER|DT_BOTTOM|DT_SINGLELINE,
SLIDE_COLOR);
Thanks all. Tag: MMX registers Tag: 279130
ms visual studio 2005 building older application - error C2143: syntax error : missing '{' before '__stdcall'
Hi.
I am very unfamiliar with VC++, having mostly other compiler experience in my
past.
I have installed visual studio 2005 and am trying to build an application that
supposedly built fine previously with Visual Studio c++ 6.0.
preprocessor definitions are: WIN32;_DEBUG;_WINDOWS
On this line (the BOOL __export CALLBACK line) in a ".c" (c not c++) file:
BOOL __export CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM
lParam)
{switch (message) {case WM_INITDIALOG:return (TRUE); ...
I get this error:
error C2143: syntax error : missing '{' before '__stdcall'
Can someone recommend a course of action, or tell me what the problem is?
thanks
Jeff
Jeff Kish Tag: MMX registers Tag: 279115
Window Message (WM_xxxx)
Hi all, (and please forgive my frenchy english!)
I'm using VS PRO 2005, developing API without MFC.
I'd like to know the Message that is send to the program when the
window is dragged out of the screen, in order to correctly redraw it.
Thanks in advance, and feel free to ask more details.
regards,
Thomas. Tag: MMX registers Tag: 279114
Problem using unmanaged static libs from managed C++ Windows Form Application in VC2005
I have some Static libs which were intially implemented in VC6 and
then converted to VC2005.
When I try to use these in my managed C++ application, I am getting
the following exception:
An unhandled exception of type 'System.TypeInitializationException'
occurred in Unknown Module.
Additional information: The type initializer for '<Module>' threw an
exception.
Any comments/url is appreciated.
Here is the output :
-------------------------------------
First-chance exception at 0x1021c0a7 (msvcr80d.dll) in NewTestVC.exe:
0xC0000005: Access violation reading location 0xae59162c.
A first chance exception of type 'System.AccessViolationException'
occurred in NewTestVC.exe
First-chance exception at 0x7c96df51 in NewTestVC.exe: 0xC0000005:
Access violation reading location 0xae591630.
A first chance exception of type
'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
A first chance exception of type
'<CrtImplementationDetails>.ModuleLoadExceptionHandlerException'
occurred in msvcm80d.dll
First-chance exception at 0x7c812a5b in NewTestVC.exe: Microsoft C++
exception: [rethrow] at memory location 0x00000000..
An unhandled exception of type 'System.TypeInitializationException'
occurred in Unknown Module.
Thanks a lot for the help, Tag: MMX registers Tag: 279111
VS 2005 conditional compilation syntax coloring
hi
I have some code which looks like this
#if defined (XYZ_PQ)
// do something
#endif
In my project settings , under c++ settings I have set the XYZ_PQ
macro as a preprocessor define.
WHen I debug I am able to set a breakpoint in the code,
but the syntax coloring colors the code grey and if I right click on
the code, the go to definition and go to declration part are greyed
out!
how to do get the editor to identify that the symbol is defined.
Regards
Chiman Tag: MMX registers Tag: 279106
redirecting cout - is it possible with dynamically loaded DLL?
Folks,
I am redirecting the standard output from my console application to a
log file.
Dynamically loaded DLLs seem not the see this redirection, and still
echo on the console.
Here is the sequence of events in more detail:
1) Starting console application from the command prompt.
2) The application loads a shared library using the "LoadLibraryEx"
function.
The library is loaded and correctly executes an initialization
routine.
3) The console application now redirects cout to a new file.
The (simplified) code used to achieve this is as follows:
log.open(x.c_str(), ios::out);
cout.rdbuf(log.rdbuf());
4) Logging statements in the main application (coded with "cout <<")
write to the new file, as expected.
Logging statements in the shared library (also coded with "cout
<<") continue to be logged to the console, which is not what I want.
Switching the order of steps 2 and 3 doesn't change the behavior.
The code does work fine when running under Linux.
Is the above behavior expected? Or, am I missing something? Any
solutions or alternatives?
All input greatly appreciated,
Johan Tag: MMX registers Tag: 279105
[Music Movies Soft] Free binaries search & download = www.GEGEREKA.com
Project of the year: Incredible unique search machine like nothing on earth.
MP3,MPEG,AVI,DIVX,DLL,PHP,EXE,ISO, ...and much more
Millions files for everyone. Music, movies, soft and other media.
http://www.GEGEREKA.com : THE LORD OF DOWNLOADS. Tag: MMX registers Tag: 279095
win32 project error
hey all,
i have a simple window in which i'm just adding a combo box to and i'm
getting an error when i close the window:
Here's the code:
m_hGenderCombo = CreateWindow("COMBOBOX", "", WS_VISIBLE | WS_CHILD |
LBS_STANDARD, 10, 150, 150, 150, m_hWnd,
(HMENU)IDC_GENDER, m_hInstance, NULL);
and the error:
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Error!
Program: ...
HEAP CORRUPTION DETECTED: after Normal block (#48) at 0x00894F58.
CRT detected that the application wrote to memory after end of heap buffer.
(Press Retry to debug the application)
---------------------------
Abort Retry Ignore
--------------------------- Tag: MMX registers Tag: 279092
Extending the cursor outside the activex control
Hi,
>From my activex control i need to change the cursor of the container
application. Is there any possible way for doing so?
Regards,
Jo. Tag: MMX registers Tag: 279088
How to show a bmp image
How can I show a jpg image? It's just the splash image that should come up
when someone starts my program.
Here is my code, which doesn't bring up the image:
HDC desktopHDC = GetWindowDC(NULL);
HDC splashHDC = CreateCompatibleDC(desktopHDC );
HBITMAP splashBM = CreateCompatibleBitmap(desktopHDC, 480, 180);
SelectObject(splashHDC, "C:\\Dev\\AnanyaCurves\\ACPSPlugin\\splash.bmp");
int width = GetSystemMetrics(SM_CXSCREEN);
int height = GetSystemMetrics(SM_CYSCREEN);
BitBlt(desktopHDC, (int)(0.5*((double)width)) -
240, (int)(0.5*((double)height)) - 90, 480, 180, splashHDC, 0, 0, SRCCOPY);
It looks like that the SelectObject doesn't work. How can I access my .bmp
file?
(Also, how can I do the same thing on the Mac?)
Thanks for your time! Tag: MMX registers Tag: 279087
LINQ sentence error
Hi
I have VS .NET 2005 and I install LinQ preview for C#.
I'm try to make some thing using LINQ.
IT returns error in this sentence :
var query = from p in people.People
from s in people.Salaries
where p.ID == s.ID)
select new { p.LastName, p.FirstName, s.Year,
s.SalaryYear};
And don't recognize this Sintax.
I will be grateful for your help
--
Thanks ,
Pedro Tag: MMX registers Tag: 279083
THE LORD OF DOWNLOADS: MP3,Movies,Soft = www.GEGEREKA.com
MP3,MPEG,AVI,DIVX,DLL,PHP,EXE,ISO, ... and much more
Millions files for everyone. Music, movies, soft and other media.
Get it now!! http://www.GEGEREKA.com Tag: MMX registers Tag: 279082
Free Software search and download = www.GEGEREKA.com
Project of the year: Incredible unique search machine like nothing on earth.
MP3,MPEG,AVI,DIVX,DLL,PHP,EXE,ISO, ... and much more
Millions files for everyone. Music, movies, soft and other media.
http://www.GEGEREKA.com : THE LORD OF DOWNLOADS. Tag: MMX registers Tag: 279080
Free Software search and download = www.GEGEREKA.com
Project of the year: Incredible unique search machine like nothing on earth.
MP3,MPEG,AVI,DIVX,DLL,PHP,EXE,ISO, ... and much more
Millions files for everyone. Music, movies, soft and other media.
http://www.GEGEREKA.com : THE LORD OF DOWNLOADS. Tag: MMX registers Tag: 279079
Excerpt from old C Book
hey all,
I read this in an old C book that had the following sentence in it:
"If you want your application to be portable, you should restrict yourself
to Standard library functions."
Does this still apply today in vs2005? where would this standard library be
found?
thanks,
rodchar Tag: MMX registers Tag: 279078
Creating a standalone .exe with VC++ 2005.
Is it possible to create a standalone .exe which doesn't require
MSVCXX80.dll's? For example, if I need to create an install (or setup)
exe, then the exe should be able to run without any libraries
installed. It looks like MFC libraries can be statically linked so
that MFCXX.dlls are not required. How about MSVCxx.dll's?
Thank you. Tag: MMX registers Tag: 279075
Creating a standalone .exe with VC++ 2005.
Is it possible to create a standalone .exe which doesn't require
MSVCXX80.dll's? For example, if I need to create an install (or setup)
exe, then the exe should be able to run without any libraries
installed. It looks like MFC libraries can be statically linked so
that MFCXX.dlls are not required. How about MSVCxx.dll's?
Thank you. Tag: MMX registers Tag: 279069
VC2005: incorrect warning C4267
Hi to all,
the following sample triggers warning C4267, but that's incorrect, because
the bitfields have the same size.
Is there some subtle motivation?
struct AAA
{
size_t a : 32;
size_t b : 32;
};
int main()
{
AAA x;
x.a = 19;
x.b = x.a; // warning C4267
return 0;
} Tag: MMX registers Tag: 279066
MP3 AVI DIVX MPEG SOFT = www.GEGEREKA.com
Millions files for everyone. Music, movies, soft and other media.
Check it now!! http://www.gegereka.com Tag: MMX registers Tag: 279057
STL vector - which style of for() loop?
Hi,
I have this code below, and would like to know which for() loop style is
best - the second one seems a bit of a mouthful!
* Beware line wrap *
int _tmain(int argc, _TCHAR* argv[])
{
// Call a function that populates strings
vector< string > TheStrings;
TheStrings = returnStrings();
for(unsigned i = 0; i < TheStrings.size(); i++) {
cout << TheStrings[i] << endl;
}
for(vector<string>::iterator myIterator = TheStrings.begin();
myIterator != TheStrings.end(); myIterator++)
{
cout << *myIterator << endl;
}
return 0;
}
vector< string > returnStrings()
{
// From Google Groups, demo of how to return a vector from a func
vector< string > Strings;
Strings.push_back( "hello" );
Strings.push_back( "hello1" );
Strings.push_back( "hello2" );
return Strings; // Original author didn't have this?
}
--
Gerry Hickman (London UK) Tag: MMX registers Tag: 279040
Class View
I added a bunch of existing .cpp files to my project, but the classes
aren't showing up in the Class View.
Anyone know how to fix this?
I am using Visual Studio.NET 2002. Tag: MMX registers Tag: 279037
How create browse file dialog that can select files greater MAX_PA
I need a browse dialog that can select files that have file paths longer then
_MAX_PATH(260).
I've tried using GetOpenFileName, but I get a "File name is invalid" error
when I select a file with a name longer then 260 (_MAX_PATH) characters.
Does anyone have a method or know of an existing library/project that can
display a browse dialog which can select file names longer then 260
characters?
--
-----------------------------------------------
Top Ten Expert in Experts-Exchange C++ and MFC topic area.
http://www.experts-exchange.com/Cplusplus
------------------------------------------------ Tag: MMX registers Tag: 279031
Enum plus std::vector questions
Question 1:
I use enum in my application
enum {
APPLE = 1,
ORANGE,
PEAR,
WATER_MELON
};
When I probe a variable of say APPLE, it just shows '1' rather than
'APPLE'... how do i fix that?
Question 2:
if I have a std::vector<FRUIT> fruitarr; ,
When I want to add a new item, do I just do a or b? Or both of them are
just fine
a) memcpy (fruitarr[count], fruit, sizeof(fruit));
b) or fruitarr[count] = fruit;
Thanks in advance
Jack Tag: MMX registers Tag: 279017
MessageBox question
When I'm using the MessageBox() function, user can still click on the window
below it to ignore the messagebox. Is there anyway to make the message box
kind of mandatory? (can't be ignored unless clicked ok.)
Thanks,
Alan Tag: MMX registers Tag: 279013
I was just wondering if there is a way to tell Visual Studio to use
the MMX registers to improve performance.
<bob@coolgroups.com> wrote:
> I was just wondering if there is a way to tell Visual
> Studio to use
> the MMX registers to improve performance.
No, there is no way. You will need to write a code by
yourself. However, there is /arch compiler option, which
will instruct a compiler to use SSE/SSE2 instruction set.