Click here to Skip to main content
16,011,358 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: resource.h control definition problem Pin
Caudata1-Sep-07 14:32
Caudata1-Sep-07 14:32 
AnswerRe: resource,h control definition problem Pin
Caudata1-Sep-07 18:32
Caudata1-Sep-07 18:32 
QuestionTrouble with const Pin
Leslie Sanford31-Aug-07 13:19
Leslie Sanford31-Aug-07 13:19 
AnswerRe: Trouble with const Pin
Mark Salsbery31-Aug-07 13:26
Mark Salsbery31-Aug-07 13:26 
GeneralRe: Trouble with const Pin
Leslie Sanford31-Aug-07 13:41
Leslie Sanford31-Aug-07 13:41 
GeneralRe: Trouble with const Pin
Mark Salsbery31-Aug-07 13:52
Mark Salsbery31-Aug-07 13:52 
QuestionRe: Trouble with const Pin
Mark Salsbery31-Aug-07 13:54
Mark Salsbery31-Aug-07 13:54 
AnswerRe: Trouble with const Pin
Leslie Sanford31-Aug-07 14:22
Leslie Sanford31-Aug-07 14:22 
Mark Salsbery wrote:
Pass it how?


It's passed to the setter from the constructor. So in the Sawtooth.cpp file, I have the const array defined:

const unsigned char Sawtooth[] =
{
    // A bunch of values.
};


In my Wavetable.h file, I have the declaration:

extern const unsigned char Sawtooth[];


In my Oscillator class, I have an const unsigned char pointer member:

class Oscillator
{
private:
    const unsigned char *wavetable;
 
// Stuff...
 
public:
    void SetWavetable(const unsigned char *wavetable);
};


In my constructor I do this:

#include "Wavetable.h"
 

Oscillator::Oscillator()
{
    SetWavetable(Sawtooth);
}


In other words, I want the wavetable member to point to the Sawtooth array when an Oscillator is created.

[EDIT]
Oscillator.obj : error LNK2019: unresolved external symbol "unsigned char const * const Sawtooth"

That's part of the error message. It's as if the compiler wants to treat my Sawtooth array as an unsigned char const * const.
[/EDIT]
GeneralRe: Trouble with const Pin
Mark Salsbery31-Aug-07 15:36
Mark Salsbery31-Aug-07 15:36 
GeneralRe: Trouble with const Pin
Leslie Sanford31-Aug-07 16:02
Leslie Sanford31-Aug-07 16:02 
GeneralRe: Trouble with const Pin
Mark Salsbery1-Sep-07 7:05
Mark Salsbery1-Sep-07 7:05 
AnswerRe: Trouble with const Pin
Leslie Sanford31-Aug-07 15:04
Leslie Sanford31-Aug-07 15:04 
GeneralRe: Trouble with const Pin
Mark Salsbery31-Aug-07 15:33
Mark Salsbery31-Aug-07 15:33 
QuestionHow ot verify whether or not a user is a member of a local or domain group? Pin
Homayoun231-Aug-07 13:12
Homayoun231-Aug-07 13:12 
QuestionMFC Control Design Pattern Question Pin
@largeinsd31-Aug-07 10:56
@largeinsd31-Aug-07 10:56 
QuestionCStdioFile issue Pin
__yash__31-Aug-07 10:40
professional__yash__31-Aug-07 10:40 
AnswerRe: CStdioFile issue Pin
__yash__31-Aug-07 10:48
professional__yash__31-Aug-07 10:48 
QuestionCListCtrl::SetBkImage(): how disable the image scroll? Pin
Cris31-Aug-07 8:27
Cris31-Aug-07 8:27 
AnswerRe: CListCtrl::SetBkImage(): how disable the image scroll? Pin
Cris3-Sep-07 3:13
Cris3-Sep-07 3:13 
QuestionCancel opening a file Pin
AeJai31-Aug-07 8:10
AeJai31-Aug-07 8:10 
AnswerRe: Cancel opening a file Pin
PJ Arends31-Aug-07 9:38
professionalPJ Arends31-Aug-07 9:38 
QuestionWM_TIMER Pin
__yash__31-Aug-07 7:28
professional__yash__31-Aug-07 7:28 
AnswerRe: WM_TIMER Pin
Mark Salsbery31-Aug-07 8:01
Mark Salsbery31-Aug-07 8:01 
GeneralRe: WM_TIMER Pin
Waldermort31-Aug-07 9:33
Waldermort31-Aug-07 9:33 
GeneralRe: WM_TIMER Pin
Mark Salsbery31-Aug-07 9:42
Mark Salsbery31-Aug-07 9:42 

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.