|
Bonjour! when i try to define a CArray as a static class member i get a link error. what's the problem, and how can i solve it? thx
derhackler
|
|
|
|
|
Please provide error description (or source of your class) to give us the idea of your problem.
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
this is the code of the header file:
#include <afxtempl.h>
class CPropertyList
{
public:
CPropertyList();
virtual ~CPropertyList();
public:
static CString fnGetADsProperty(int intArg);
static CString fnGetADsProperty(CString cstrArg);
static int fnGetIntProperty(CString cstrArg);
static CString fnGetProperty(int intArg);
static CString fnGetProperty(CString cstrArg);
//Statische members
static CArray<cstring,cstring&> cstraProperty;
static CArray<cstring,cstring&> cstraADsProperty;
static CArray<int,int> intaProperty;
};
this ist the error i get (for each CArray)
PropertyList.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public: static class CArray<class cstring,class="" cstring="" &=""> CPropertyList::cstraProperty" (?cstraProperty@CPropertyList@@2V?$CArray@VCString@@AAV1@@@A)
any ideas?
derhackler
es ist wie es ist und es ist und es ist fürchterlich
|
|
|
|
|
CArray is the template class - so you need to provide template parameters!
Like that:
class CPropertyList
{
...
static CArray<cyourclass, cyourclass&=""> cstraProperty;
static CArray<cyourclass, cyourclass&=""> cstraADsProperty;
static CArray<cyourclass, cyourclass&=""> intaProperty;
};
and your always must define static variables (the code above is the declaration only!):
this code your should place out of class declaration! (most of us placing this in CPP file :
CArray<cyourclass, cyourclass&=""> CPropertyList::cstraProperty;
.. the same for others static members.
Hope it'll help.
#include
class CPropertyList
{
public:
CPropertyList();
virtual ~CPropertyList();
public:
static CString fnGetADsProperty(int intArg);
static CString fnGetADsProperty(CString cstrArg);
static int fnGetIntProperty(CString cstrArg);
static CString fnGetProperty(int intArg);
static CString fnGetProperty(CString cstrArg);
//Statische members
static CArray cstraProperty;
static CArray cstraADsProperty;
static CArray intaProperty;
};
this ist the error i get (for each CArray)
PropertyList.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public: static class CArray CPropertyList::cstraProperty" (?cstraProperty@CPropertyList@@2V?$CArray@VCString@@AAV1@@@A)
any ideas?
derhackler
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
CArray is the template class - so you need to provide template parameters!
Like that:
class CPropertyList
{
...
static CArray<cyourclass, cyourclass&=""> cstraProperty;
static CArray<cyourclass, cyourclass&=""> cstraADsProperty;
static CArray<cyourclass, cyourclass&=""> intaProperty;
};
and your always must define static variables (the code above is the declaration only!):
this code your should place out of class declaration! (most of us placing this in CPP file :
CArray<cyourclass, cyourclass&=""> CPropertyList::cstraProperty;
.. the same for others static members.
Hope it'll help.
ps: just've seen your post on codeguru
#include
class CPropertyList
{
public:
CPropertyList();
virtual ~CPropertyList();
public:
static CString fnGetADsProperty(int intArg);
static CString fnGetADsProperty(CString cstrArg);
static int fnGetIntProperty(CString cstrArg);
static CString fnGetProperty(int intArg);
static CString fnGetProperty(CString cstrArg);
//Statische members
static CArray cstraProperty;
static CArray cstraADsProperty;
static CArray intaProperty;
};
this ist the error i get (for each CArray)
PropertyList.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public: static class CArray CPropertyList::cstraProperty" (?cstraProperty@CPropertyList@@2V?$CArray@VCString@@AAV1@@@A)
any ideas?
derhackler
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
CArray is the template class - so you need to provide template parameters!
Like that:
class CPropertyList
{
...
static CArray<cyourclass, cyourclass&=""> cstraProperty;
static CArray<cyourclass, cyourclass&=""> cstraADsProperty;
static CArray<cyourclass, cyourclass&=""> intaProperty;
};
and your always must define static variables (the code above is the declaration only!):
this code your should place out of class declaration! (most of us placing this in CPP file :
CArray<cyourclass, cyourclass&=""> CPropertyList::cstraProperty;
.. the same for others static members.
Hope it'll help.
ps: just've seen your post on codeguru
#include
class CPropertyList
{
public:
CPropertyList();
virtual ~CPropertyList();
public:
static CString fnGetADsProperty(int intArg);
static CString fnGetADsProperty(CString cstrArg);
static int fnGetIntProperty(CString cstrArg);
static CString fnGetProperty(int intArg);
static CString fnGetProperty(CString cstrArg);
//Statische members
static CArray cstraProperty;
static CArray cstraADsProperty;
static CArray intaProperty;
};
this ist the error i get (for each CArray)
PropertyList.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public: static class CArray CPropertyList::cstraProperty" (?cstraProperty@CPropertyList@@2V?$CArray@VCString@@AAV1@@@A)
any ideas?
derhackler
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
Hell, the system eats brackets
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
i've seen it.
|
|
|
|
|
ups. ther's something wrong with the forum code. it ignores the template parameters! but i've specified the parameters like CArray[CString,CString&] (i use other brakets). so something else must be wrong.
|
|
|
|
|
define the static members as I did in previouse post (some minuts ago - it should help. Yes - I see the templates problem - is not a reason !
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
ah!!! i see the problem. initializing the arrays is not a want - it's a must!! now my code compiles. thank you!!!
es ist wie es ist und es ist fürchterlich!
|
|
|
|
|
Hi everybody, I don't remeber if I ask this question before but I will try to take a chance to ask it again.
If there anybody know how to Link a ClistCtrl with a CTreeView like Windows Explorer when you click on a tree item the list show always different items ?
Can you tell me where I Can find reference on that or source code, tutorials or can you explain it to me in details ?
TIA
BLaZe
ICQ # 110244345
email : mpblaze@iquebec.com
|
|
|
|
|
G'day,
How about implementing a vertical splitter window and putting a tree control view in one pane and a list control view in the other?
Then handle item selections in the tree and notifying the list view so that it's contents are synchronized with the tree.
There may be a better way of handling this, but that's the best I can come up with for the moment.
Hope this helps,
Steve
|
|
|
|
|
Yes thank you
but do you know where I can find Source or do you have a little BASIC
program (exemple) for demonstrate this because I'm not very familiar with
the Handle of a Tree
TIA
BLaZe
BLaZe
ICQ # 110244345
email : mpblaze@iquebec.com
|
|
|
|
|
make a new project ... choose an sdi app ... choose a windows explorer style app ... change the right view base class to be clistview ... compile ... voila
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Yes thank you
but do you know where I can find Source or do you have a little BASIC
program (exemple) for demonstrate how to change the ListView
TIA
BLaZe
BLaZe
ICQ # 110244345
email : mpblaze@iquebec.com
|
|
|
|
|
how to change the listview? you mean update it on an event? thats all in the docs and is very straightforward ... as for a basic example program with code ... thats what the app wizard gives you ... look thru the code it generates to at least see what is going on
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Hi,
I need to write a large amount of data into a file, but the limitation of a file under windows is 4G. How can I handle this situation safely?
Thanks.
|
|
|
|
|
write the file into a sequence of numbered sub-files (i would include a file header of my own design that kept the name of the file sequence and the sequence number safe inside)
the sub-file size would depend on how you have to read it back in but i would consider maybe 20mb to 50mb blocks ... its still going to be a real bore for the folks waiting to load even a portion of the overall file but its better than waiting for the whole thing to arrive in memory
you do of course have a machine with vast amounts of ram and virtual memory i assume or loading in is a real no-no
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
When I execute program under debugger I receive message:
HEAP[aaa.exe]: Invalid Address specified to RtlFreeHeap( 1c50000, 1608938 )
But visual problems with pointers doesn't exist.
Can you advice me something.
|
|
|
|
|
in my experience this usually means you have allocated some memory blocks and either over or underwritten the allocated space ... check you don't exceed the amount of memory you allocated
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
You may want to verify mixed libraries in your linkage - debug and release builds. The memory allocated in debug builds has some additional space that does not exist in release mode (see for ex, help _calloc_dbg in MSDN). The solution then is to link only the same builds of your libs (either debug or release).
|
|
|
|
|
I have developed a regular DLL which contains dialog
resource, having ActiveX control along with other windows controls. I
have exported a function which calls DoModal function on that dialog.
But when I call this function in another application ( using explict
linking - LoadLibrary..) it does not display the dialog box and returns
-1 . It works fine when there is no ActiveX control.
Please let me know the solution for
Capizzi Filippo
|
|
|
|
|
I enumerate the encoders registered on my computer(such as:Cinepak Codec by Radius, MJPEG Compressor,DivX MPEG-4 Fast-Motion...).Then how can I select one of them (Such as DivX Fast-Motion) to compress the timeline using DirectShow filters?
Note:
These encoder have the same CLSID(CLSID_AVICo),only FccHandler and FridenlyName are different.How to select one of them?
Thanks!
|
|
|
|
|
Well I have been at it for some time, searched the newsgroups and all, but in the end found nothing.
I create my toolbars with this call:
g_hwndTB[j] = CreateWindowEx(0, TOOLBARCLASSNAME, (LPSTR) NULL,
TBSTYLE_TOOLTIPS | TBSTYLE_FLAT | CCS_NODIVIDER, 0, 0, 0, 0, hwndParent, 0, g_hInst, NULL);
j is the specific toolbar, this is a loop creating each toolbar in sucession. I add the bitmaps, the buttons, etc. Then I create the rebar:
HWND hwndRb = CreateWindowEx(WS_EX_TOOLWINDOW, REBARCLASSNAME, (LPSTR) NULL, RBS_VARHEIGHT |
RBS_AUTOSIZE | RBS_BANDBORDERS | RBS_DBLCLKTOGGLE | RBS_REGISTERDROP | RBS_VARHEIGHT | CCS_NODIVIDER | CCS_NOPARENTALIGN | RBS_VERTICALGRIPPER | WS_BORDER | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE, 0, 0, 0, 0, hwndParent, 0, g_hInst, NULL);
After this I insert the bands as follows:
REBARBANDINFO rbbi;
rbbi.cbSize = sizeof(REBARBANDINFO);
rbbi.fMask = RBBIM_COLORS | RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_STYLE | RBBIM_ID | RBBIM_SIZE;
rbbi.clrFore = GetSysColor(COLOR_BTNTEXT);
rbbi.clrBack = GetSysColor(COLOR_BTNFACE);
rbbi.fStyle = RBBS_NOVERT | RBBS_CHILDEDGE ;
for(int i=0; i
|
|
|
|