Click here to Skip to main content
15,915,600 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC, c++ windows programming audio books Pin
Phil0053-Jan-12 1:55
Phil0053-Jan-12 1:55 
GeneralRe: MFC, c++ windows programming audio books Pin
Phil0054-Jan-12 3:57
Phil0054-Jan-12 3:57 
QuestionCreateProcessAsUser Question Pin
Lucidation30-Dec-11 11:29
Lucidation30-Dec-11 11:29 
AnswerRe: CreateProcessAsUser Question Pin
Richard Andrew x6430-Dec-11 14:47
professionalRichard Andrew x6430-Dec-11 14:47 
GeneralRe: CreateProcessAsUser Question Pin
Lucidation31-Dec-11 11:21
Lucidation31-Dec-11 11:21 
GeneralRe: CreateProcessAsUser Question Pin
Richard Andrew x6431-Dec-11 15:06
professionalRichard Andrew x6431-Dec-11 15:06 
GeneralRe: CreateProcessAsUser Question Pin
Lucidation5-Jan-12 4:40
Lucidation5-Jan-12 4:40 
GeneralRe: CreateProcessAsUser Question Pin
Richard Andrew x645-Jan-12 8:03
professionalRichard Andrew x645-Jan-12 8:03 
GeneralRe: CreateProcessAsUser Question Pin
Lucidation5-Jan-12 13:38
Lucidation5-Jan-12 13:38 
GeneralRe: CreateProcessAsUser Question Pin
Richard Andrew x645-Jan-12 13:45
professionalRichard Andrew x645-Jan-12 13:45 
GeneralRe: CreateProcessAsUser Question Pin
Lucidation6-Jan-12 12:25
Lucidation6-Jan-12 12:25 
GeneralRe: CreateProcessAsUser Question Pin
Richard Andrew x646-Jan-12 12:53
professionalRichard Andrew x646-Jan-12 12:53 
QuestionCommand Routing From CDialogBar to CMainFrame Pin
sdancer7530-Dec-11 9:41
sdancer7530-Dec-11 9:41 
SuggestionRe: Command Routing From CDialogBar to CMainFrame Pin
Randor 30-Dec-11 15:06
professional Randor 30-Dec-11 15:06 
QuestionIntializing a structure array to store SQL Results from a class Pin
jkirkerx30-Dec-11 7:15
professionaljkirkerx30-Dec-11 7:15 
AnswerRe: Intializing a structure array to store SQL Results from a class Pin
Code-o-mat30-Dec-11 8:30
Code-o-mat30-Dec-11 8:30 
GeneralRe: Intializing a structure array to store SQL Results from a class Pin
jkirkerx30-Dec-11 9:15
professionaljkirkerx30-Dec-11 9:15 
GeneralRe: Intializing a structure array to store SQL Results from a class Pin
Code-o-mat30-Dec-11 9:33
Code-o-mat30-Dec-11 9:33 
GeneralRe: Intializing a structure array to store SQL Results from a class Pin
jkirkerx30-Dec-11 10:01
professionaljkirkerx30-Dec-11 10:01 
GeneralRe: Intializing a structure array to store SQL Results from a class Pin
Code-o-mat30-Dec-11 10:06
Code-o-mat30-Dec-11 10:06 
GeneralRe: Intializing a structure array to store SQL Results from a class Pin
jkirkerx31-Dec-11 8:51
professionaljkirkerx31-Dec-11 8:51 
Did I get this right?

I'm missing something here, I get a single structure, and not an array structure. I just keep writing the data to the same single structure. I must be missing something in the class, but I'm not sure what. Or maybe I didn't initialize it right.

This is for populating the array
if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS) {
	UA_Listbox **uaPtr;
	uaPtr = new UA_Listbox*[dwCount];
	INT	i = 0;
	INT	pzUserID;
	WCHAR	pzFirstName[cbFirstName];
	WCHAR	pzLastName[cbLastName];
	WCHAR	pzUserName[cbUserName];						

	while (SQLFetch(hstmt) == SQL_SUCCESS) {
		// Get Data from the Table
		SQLGetData(hstmt, 1, SQL_C_ULONG, &pzUserID, 0, NULL );
		SQLGetData(hstmt, 2, SQL_C_WCHAR, &pzFirstName, cbFirstName, NULL );
		SQLGetData(hstmt, 3, SQL_C_WCHAR, &pzLastName, cbLastName, NULL );
		SQLGetData(hstmt, 4, SQL_C_WCHAR, &pzUserName, cbUserName, NULL );

		// Transfer Pointers to Structure
		uaPtr[i] = new UA_Listbox;
		uaPtr[i]->iUserID = pzUserID;
		uaPtr[i]->szFirstName = pzFirstName;
		uaPtr[i]->szLastName = pzLastName;
		uaPtr[i]->szAccountName = pzUserName;
		++i;
	} 


This is the class

VB
class UA_Listbox {

public:

    INT             iUserID;
    WCHAR           *szFirstName;
    WCHAR           *szLastName;
    WCHAR           *szAccountName;

    UA_Listbox():
        iUserID(0),
        szFirstName(NULL),
        szLastName(NULL),
        szAccountName(NULL)
    {
        // Constructor

    }

    ~UA_Listbox()
    {
        // Deconstructor

    }

};

GeneralRe: Intializing a structure array to store SQL Results from a class Pin
Code-o-mat31-Dec-11 8:57
Code-o-mat31-Dec-11 8:57 
AnswerRe: Intializing a structure array to store SQL Results from a class Pin
jschell30-Dec-11 8:35
jschell30-Dec-11 8:35 
GeneralRe: Intializing a structure array to store SQL Results from a class Pin
jkirkerx30-Dec-11 9:22
professionaljkirkerx30-Dec-11 9:22 
GeneralRe: Intializing a structure array to store SQL Results from a class Pin
Vaclav_30-Dec-11 12:24
Vaclav_30-Dec-11 12:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.