|
Thanks David, but I have a #define check at the top.
I learned from another source that the problem is that there is a global variable "int nXYSwap" used for a macro "#define XYSWAP(x,y) (nXYSwap=x,x=y,y=nXYSwap)"
so adding extern to the int declaration was the suggested solution, however that cause unresolved external error with the macro still trying to call the varaible.
I don't know what to make of it. here is the problem area if anyone is interested:
extern int nXYSwap;
#define XYSWAP(x,y) (nXYSwap=x,x=y,y=nXYSwap)
Thanks for the reply!
Steve
|
|
|
|
|
#define XYSWAP((x),(y)) {int z=(x);(x)=(y);(y)=z;}
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
!!
Thanks MAN! Obviously I don't know what I can do w/ macros.... this is great, thanks so much.
|
|
|
|
|
A better solution to the macro XYSWAP would be a templated function such as this:
<template typename T>
void XYSWAP(T& left, T& right) {
T tmp(left);
left = right;
right = tmp;
} There you have a function which
1) is type safe: you can't swap an int with a float
2) is type polymorphic (you can use it to swap other types than int
3) is reusable, thanks to 2)
4) does not rely on global variables
The template function simply replaces the macro in the header file.
--
C'est normal!
|
|
|
|
|
|
Is it possible to open a dialog (resource, DoModal()?) by clicking on a link in an htmlview?
Thanks,
Frank
"Keyboard Error - Press F1 to Continue"
|
|
|
|
|
Hi,
Dose anybody know where can i download "Server 2003 DDK", and i need to write a program to comunicate and transfer files with a remote computer via modem with this protocols (ZMODEM/XMODEM), can you send me some hint or source code links to help me to start it.
Thanx in advance.
|
|
|
|
|
you can't download the DDK anymore... order it from microsoft.
Don't try it, just do it!
|
|
|
|
|
i knowwwww, that's why i asked for;)
anyways actually im new to the ddk and im not sure if i order it, then i can use it for this purpose, im just wanna impelement something like windows hyperterminal,... got any clue?
thanx
|
|
|
|
|
Hi!
When I run my MFC project in the debugger of Visual C++ the main thread exits with code 0x2. Does this mean anything? Before a while it always exited with a code like 0x8003.
Is there anywhere a list where one can see what those return codes mean? Or do they just mean nothing??
Thanks in advance
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)
|
|
|
|
|
Thread return values have no specific meaning. The value returned from WinMain or a thread's thread proc is the return value you see in the debugger.
In the DOS days, external commands would return 0/non-zero for success/failure.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0.1! | RightClick-Encrypt
Actual sign at the laundromat I go to: "No tinting or dying."
|
|
|
|
|
In an MFC app, the main thread return code is whatever was given to the ::PostQuitMessage() function or whatever the wParam is of the WM_QUIT message it received.
|
|
|
|
|
The thread return value is determined by the parameter passed to the PostQuitMessage function. In most of the cases, these return values are determined automatically, although you can change that behaviour by overriding the WM_QUIT message handler. The exit value is carried in the WPARAM parameter of the handler.
The return codes are used only to give information of the state in which the application exited. In order to determine the value, you must step through your code to the point where the application terminates and see why it quitted.
As the return values are developer-specific (excluding certain constant values like TRUE & FALSE), there is no comprehensive list.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi,
I am interested in the SQL programming in the windows platform using raw win32 API, MFC, and COM technology. I have some basic questions.
- What are the key differences between ODBC, DAO, ADO, and OLE with regards to SQL programming under windows platform?
- Is any of that technology obsolete? What is the most widely used technology (above)?
- I know there are MFC wrapper classes for ODBC and DAO. Is ADO primarily used by VB and C# programmers?
I am a C++ programmer and have no problem working with raw win32 API, MFC, and COM (including ActiveX). What is the most powerful (speed/efficiency, extensibility, features, etc) technology for SQL programming in the windows platform?
Thanks,
Kuphryn
|
|
|
|
|
In my experience ODBC and ADO are the most widely used technologies to talk to SQL Servers.
kuphryn wrote:
I know there are MFC wrapper classes for ODBC and DAO. Is ADO primarily used by VB and C# programmers?
There are plenty of wrapper classes here on CP for ADO. Or you could use the #import pre-processor and let it create a wrapper of the ADO Com object.
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
for speed use raw odbc and pass direct queries thru
"there is no spoon" biz stuff about me
|
|
|
|
|
Dear All,
Pls help me as am a novice to programming especially in VC and don’t know how to mask a voice using FFT. Is there any other way throurh which I can change or mask the voice. Or anyother code through which i be able to mask or change the voice. (.wav file) Or any function which can change the pitch of the wav file.
Pls I need ur help badlly as am running out of time for my final project.
Kind regards
Jenny
|
|
|
|
|
Maybe this url helps: http://digitalfilter.com/vcclass.html.
|
|
|
|
|
Hi!
Can I use a RecordView in a dialogbased app? How do I show the form in the dialog?
I have tried to add database support to a dialog but I can't seem to get it to work! The reason for using a dialog-app, is that I want to skin the dialog!
Any ideas on how to go about it?
Thanks in advance!
|
|
|
|
|
All you need to do is derive a class from CRecordset . Then in your dialog's OnInitDialog() method, put something like:
CDatabase db;
CMySet set(&db);
TRY
{
set.Open();
if (! set.IsBOF())
{
set.MoveFirst();
while (! set.IsEOF())
{
set.MoveNext();
}
}
}
CATCH(CDBException, pDBException)
{
AfxMessageBox(pDBException->m_strError);
}
END_CATCH
set.Close();
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
You wouldn't happen to have some ready-to-go source codes/project for me to have a look at?
I've been trying to find a sample project all over the place, but can't seem to find any...
I gotta be honest, I've just beginning to use the database classes, so I don't really know where to start!
|
|
|
|
|
Calder wrote:
I gotta be honest, I've just beginning to use the database classes, so I don't really know where to start!
If you are already familar with MFC, the code snippet, along with the comment, I provided should get you well on your way. Is there any particular item that is overly confusing?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
DavidCrow wrote:
If you are already familar with MFC, the code snippet, along with the comment, I provided should get you well on your way. Is there any particular item that is overly confusing?
Actually... How do I populate my controls with the data from the database?
Thanks for the help! (Highly appriciated )
|
|
|
|
|
Using ClassWizard, create a control variable for each control on the dialog. For example, of you have an edit control with a variable called m_ebName , you can set its value with:
m_ebName.SetWindowText("This is some text");
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
DavidCrow wrote:
m_ebName.SetWindowText("This is some text");
I don't think that would set any text recieved from the database/recordset... Or?
|
|
|
|