It has returned error code 87. Having been referred to MSDN, i came to know that this error code indicates that one of the functions parameter is invalid. But i am not having an idea about which parameter i am passing wrong.
Any clue?? Your help would be greatly appreciated.
I need to get the name of the local system Administrator (System is in the domain). As that name however appears in the ControlPanel->"UserAccounts" list or ControlPanel->AdministrativeTools->ComputerManagement->LocalUser and Groups->Groups and clicking on "Administrators" Group, I am trying to list out all the users under "Administrators" Group and for this purpose I am using NetLocalGroupGetMembers() and including lmaccess.h file. But I am getting the linker error "error LNK2001: unresolved external symbol _NetLocalGroupGetMembers@32". Doesn't this header file "lmaccess.h" come with Visual Studio?
Using ADSI, I can get the members of an "Administrators" group (local system) , however, that list doesn't include the name of the the local system administrator , who is a member in the domain.
Is there anyother alternative mechanism/function to get the local system Administrator Name?
I was wondering if someone could look at my code and tell me why when i try to get the average of the array it wont give me the average. It compiles, the only problem is the sum and average are the same. here is my code
// LanusArrays.cpp : Defines the entry point for the console application.
// Corey Lanus
// Test 2 Part 2
// Lanus Arrays
// Does a lot of things dealing with arrays.
// October 16, 2006
using namespace std;
const int ARRAY_SIZE = 20;
When you get all this working the way you want, be sure and check out some of the STL algorithms. They can do a lot of this for you. For educational purposes, it's always nice to do everything yourself (I started this way and am better for it), but just know that standard functions and classes do exist for some things.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
I'm doing a project where I've got 4 classes for a database. I've got CRecordSet derived classes for each of the tables I'm interacting with.
Here's an example of two of the tables:
* Part Structure. Holds the information associated with
* a part in the database's part table (for single part).
typedef CArray<part, part> MyPartArray;
class CPartsTable : public CRecordSet
// MFC Junk here
BOOL AddNew(part& p); // Adds a new part to the table
BOOL Edit(part p); // Edits an existing part
BOOL Delete(part p); // Removes a part from the table
BOOL GetList(MyPartArray& list); // Returns a list of part structs
* Board structure. Holds the information associated with
* a single board.
typedef CArray<board, board> MyBoardArray;
class CBoardTable : public CRecordSet
// MFC Junk here
BOOL AddNew(board& p);
BOOL Edit(board p);
BOOL Delete(board p);
BOOL GetList(MyBoardArray& list);
I was thinking that it would make my life much easier if I could wrap them in a common interface like so:
You could get the inheritance to work by making the interface a template, i.e.
virtual BOOL AddNew(T&)=0;
virtual BOOL Edit(T)=0;
virtual BOOL Delete(T)=0;
virtual BOOL GetList(CArray<T,T>&)=0;
class CPartsTable : public CRecordSet, ICommonTable<part>
class CBoardTable : public CRecordSet, ICommonTable<board>
This would help if you were writing a lot of generic functions that operated on the tables without needing to know the details (for instance an algorithm that deleted every second entry could be written as a template function and would work on both part and board tables). However without knowing why you think the common interface would make your life easier then it is hard to know whether this would help or not.
I have been developing C++ code for many years now, but I am relatively new to MFC. I am going through the book "Programming Windows 95 with MFC" (First Edition) by Jeff Prosise. I have carefully gone through the first seven characters of the book. I also went through all the examples and ran them on my computer with no problems. I have also written three toy MFC applications.
When I get to chapter 8 (which deals with SDI), I cannot get the example to work. I feel that MFC programs written using the SDI model are hard to understand and hard to debug. I do not see the SDI model as a big time saver for the developer. Is it really that good? By the way, if somebody has a small (say under 100 lines) MFC SDI program that they could send me, I would really appreciate it.
The reason I am learning MFC is that I want to write a 1st class Retirement Calculator. Should such a program be written as a SDI application? I am thinking that it should not.
The book you've got is really good for learning MFC.
The question I have is: what version of visual studio are you using to run the examples? I found it easy to compile the examples with VC++ 6.0. I think that the newer versions of VC++ will work but you might get some problems.
As far as the need for SDI and MDI applications: you can usually get by just using dialog based apps. However, the SDI apps provide a better design framework. This is especially true if you want to distribute your presentation code from you data handling code. The SDI framework also makes it easy to save your application's data.
One thing that might help you is to try deriving the View class from CFormView. This has the effect of combining the SDI Document/View framework with the ease of Dialog programming. (The App wizard allows you to change the View base class in the last step.)
Last Visit: 31-Dec-99 18:00 Last Update: 4-Oct-23 6:53