|
Hi
I'm trying out the new features of the new VS2008 MFC Feature Pack (TR1). Managed to make a really nice looking application using 4 or 5 different CDockablePane s. All my views are now in their own pane, and the docking works really well.
Trouble is, there's a redundant CView lingering about which I a) don't have any use for, and b) don't know how to get rid of.
I tried various ways of resizing the top-level CPaneContainer using the SetPaneSize sample provided with the feature pack, which I implemented in CMainFrame::OnSize. This does work but it kinda breaks the dockable pane functionality - i.e. you can dock panes to the almost-visible CView and the whole thing screws up.
Is there an easy way to get the benefits of CFrameWnd, and get rid of CView altogether? Whilst keeping the CDockablePane functionality.
----
Edit:
Or alternatively is there a way to prevent panes from being docked onto the CView?
----
Thanks
[d3m0n]
P.S. MSDN's Feature Pack documentation is abysmal . You get more sense from stepping into the code and having a look around to see what you can call.
Cheers
[d3m0n]
Email (replace "***" with "key")
modified on Monday, July 14, 2008 4:50 PM
|
|
|
|
|
I there
This is a bit strange... I had a project (VS 2005 Pro) with all the code written in the header (.h) files. This is an OO project, so I had the class definitions and method implementations on the same file. Then, I separated the files, definition in headers, implementation in code files. But now I get 7 unresolved external symbols and the project won't compile. The strange thing is that before the separation all was normal.
What do you guys think it can be?
Best regards
Fratelli
|
|
|
|
|
AndreFratelli wrote: What do you guys think it can be?
Nothing special, just plain old coding errors. Not sure what you are asking, I mean you did not post any error messages with the related code so I don't know what you think we can do it about it short of re-writing all the C++ documentation that already exists which wouldn't make any sense since you have already proven you don't read it.
led mike
|
|
|
|
|
led mike wrote: I don't know what you think we can do it about it short of re-writing all the C++ documentation that already exists which wouldn't make any sense since you have already proven you don't read it.
You don't even have a reason to think that. I get unresolved external symbols only after separating the code into files... Wouldn't it be reasonable it would work just as well? Before, I had this:
// file whatever.h
#ifndef __WHATEVER_H
#define __WHATEVER_H
class Whatever
{
void method();
};
void Whatever::method()
{
}
#endif
Now I have this:
// file whatever.h
#ifndef __WHATEVER_H
#define __WHATEVER_H
class Whatever
{
void method();
};
#endif
// file whatever.cpp
#include "whatever.h"
void Whatever::method()
{
}
And I get these:
caminho.obj : error LNK2019: unresolved external symbol "public: bool __thiscall Capacidade::reserva(class Fluxo)" (?reserva@Capacidade@@QAE_NVFluxo@@@Z) referenced in function "public: bool __thiscall Caminho::ligar(void)" (?ligar@Caminho@@QAE_NXZ)
caminho.obj : error LNK2019: unresolved external symbol "public: bool __thiscall Capacidade::liberta(class Fluxo)" (?liberta@Capacidade@@QAE_NVFluxo@@@Z) referenced in function "public: void __thiscall Caminho::desligar(void)" (?desligar@Caminho@@QAEXXZ)
caminho.obj : error LNK2019: unresolved external symbol "public: unsigned int __thiscall Capacidade::suporta(class Fluxo)const " (?suporta@Capacidade@@QBEIVFluxo@@@Z) referenced in function "public: bool __thiscall Caminho::ping(void)const " (?ping@Caminho@@QBE_NXZ)
grafo.obj : error LNK2019: unresolved external symbol "public: unsigned int const __thiscall No::id(void)const " (?id@No@@QBE?BIXZ) referenced in function "public: bool __thiscall Grafo::ligados(unsigned int,unsigned int)const " (?ligados@Grafo@@QBE_NII@Z)
grafo.obj : error LNK2019: unresolved external symbol "public: class No * __thiscall Ligacao::destino(void)const " (?destino@Ligacao@@QBEPAVNo@@XZ) referenced in function "public: bool __thiscall Grafo::ligados(unsigned int,unsigned int)const " (?ligados@Grafo@@QBE_NII@Z)
grafo.obj : error LNK2019: unresolved external symbol "public: unsigned int __thiscall Capacidade::custo(class Fluxo)const " (?custo@Capacidade@@QBEIVFluxo@@@Z) referenced in function "public: class Caminho __thiscall Grafo::dijkstra(unsigned int,unsigned int,class Fluxo)const " (?dijkstra@Grafo@@QBE?AVCaminho@@IIVFluxo@@@Z)
grafo.obj : error LNK2019: unresolved external symbol "public: class Capacidade * __thiscall Ligacao::capacidade(void)const " (?capacidade@Ligacao@@QBEPAVCapacidade@@XZ) referenced in function "public: class Caminho __thiscall Grafo::dijkstra(unsigned int,unsigned int,class Fluxo)const " (?dijkstra@Grafo@@QBE?AVCaminho@@IIVFluxo@@@Z)
E:\Projects\netsim\Debug\netsim.exe : fatal error LNK1120: 7 unresolved externals
I didn't include the error messages because I didn't think they would help. What I was looking for (and still am) were the kind of coding errors that would cause this, cause I really can't find what's wrong here.
I bet it will be one of those things that, when you find out what it is, you just fill like smashing the computer
regards
Fratelli
|
|
|
|
|
AndreFratelli wrote: I there
I'm sure you are.
As for your coding problems it would be helpful if you included the error messages.
Steve
|
|
|
|
|
Stephen Hewitt wrote: As for your coding problems it would be helpful if you included the error messages.
Done that =)
I already figured out what it is. I started searching what did the unresolved names add in common and notice they were all marked as inline! Removed the "inline" keyword every in the project.. and it works! Can anybody explain this? How can I solve it?
regards
Fratelli
|
|
|
|
|
That will work. Can you post your actual code: the names in the error messages don't match up to code you posted.
Steve
|
|
|
|
|
The code is kind of large for me to post it here =/ The errors refer many files and functions... Is there a way for me to post the entire source here?
regards
Fratelli
|
|
|
|
|
I think the code for inline functions must appear in your header file; you can't have just the declaration. It's similar to a macro.
|
|
|
|
|
I know that for templates, but with plain inline functions too? =/ Never happened to me before... Is this a VS thing?
regards
Fratelli
|
|
|
|
|
I am trying to write out an array and all I am getting is junk in the file.
Here's the code:
short frameData[3648];
short *p;
file.Open( "C:\\test.txt", CFile::modeCreate|CFile:: modeReadWrite);
p = (short *)Frameptr;
for ( int i=0; i<= 3647; i++)
{
frameData[i] = *p;
p++;
}
file.Write(frameData,sizeof(short)*3647);
file.Close();
modified on Monday, July 14, 2008 2:34 PM
|
|
|
|
|
aei_totten wrote: ...all I am getting is junk in the file.
How are you verifying this? What should be in the file?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I open the file and there are a bunch of weird chars, boxes, greek letters, etc. and the data is an array of numbers in the 646-780 range. I step through with the debugger and the array is populated fine.
|
|
|
|
|
Well, you asked to write the array as a binary format into the file, so each short from your array will be writte as two bytes in the file (thus resulting in garbage characters). You first have to convert each short into a string and write that string into the file.
|
|
|
|
|
|
aei_totten wrote: Thanks that was it, duh.
Yeah, imagine that! The file had in it what you told the computer to put in it! Wow, what will they think of next?
led mike
|
|
|
|
|
led mike wrote: Wow, what will they think of next?
This![^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Sure but I like to pronounce that Shamoo
Have you tried one? Does it really work? Or is it a misinfomercial?
led mike
|
|
|
|
|
led mike wrote: Does it really work?
Works great on the commercial! I haven't tried one though.
German technology - it HAS to be good!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: German technology - it HAS to be good!
Yep[^]
Two and a half years ago, the bursting of the dot-com bubble erased most of the market value of Germany's technology sector. Now, the market itself is being scrapped. Deutsche Börse, which runs the Frankfurt stock exchange, announced today that it would close the Neuer Markt -- the technology-related market that is Germany's answer to the Nasdaq -- by the end of 2003.
led mike
|
|
|
|
|
and for some reason it isn't posting a less than or equal to in my loop, I even tried to go back and edit it with no luck.
|
|
|
|
|
Okay new problem.
I decided to write the file each element at a time.
Here is the new bit of code...
for ( int i=0; i<= 3647; i++)
{
frameData[i] = *p;
temp.Format("%d ",frameData[i]);
file.Write(temp,sizeof(temp));
p++;
}
but instead of getting each number followed by a blank which is what I had intended. I get some of the numbers on top of each other (like four in a row) and some of them correct.
|
|
|
|
|
oh yeah temp is a CString
|
|
|
|
|
for ( int i=0; i <= 3647; i++ )
{
frameData[i] = *p;
temp.Format("%hd ",frameData[i]);
file.Write(temp, temp.GetLength() * sizeof(TCHAR));
p++;
}
If you're writing all text, maybe CStdioFile is a better class to use...
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks so much. I can't believe how much c++/mfc I had forgotten since switching to C sharp and Java. But somethings you just can't beat in c++. 
|
|
|
|