|
I do no if there is a limit of number on a form,
I have one form with many controls, When I need to add others, the system create duplicate control on the code and I have many duplicate errors.
That why I need to know if there is a limit.
|
|
|
|
|
There is no actual limit unless you run out of memory. But if you have to operate on a lot controls in a form, I suggest you to:
1) give up a designer and switch to manual coding.
-OR/AND-
2) merge chosen groups of controls to user controls which wouldn't paint themself in design time to avoid flickering and other artifacts while in design mode.
-OR/AND-
3) split a form onto stand-alone functional forms (depends on a kind of a project, not necessarily applicable).
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
Hi;),
i have a Sdi with a splitter (4 rows).
When i click on the maximize button the window is maximized and the 1. splitter row changes its height proportionally , but when i try to restore, nothing happens with the Splitter ;(.
Please help me !
Here is my code:
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
int iCurRow_cy = 0, iMin_cy = 0;
static int iOldWnd_cy = 0, iOldWnd_cx = 0;
int iNewCurRow_cy = 0;
static int iZaehler = 0;
static CString a, b, c, d;
iZaehler++;
if (iZaehler == 1)
{
iOldWnd_cy = cy;
a.Format("%02d",iOldWnd_cy);
b.Format("%02d",cy);
c.Format("%02d",iCurRow_cy);
d.Format("%02d",iNewCurRow_cy);
MessageBox("iOldWnd_cy: "+ a + "\ncy: " + b + "\niCurRow_cy: " + c + "\niNewCurRow_cy: " + d,"in: iZaehler == 1 " ,MB_OK);
}
if ((nType == SIZE_MAXIMIZED))
{
m_Splitter_Main.GetRowInfo(0 ,iCurRow_cy, iMin_cy);
iNewCurRow_cy = (int)ResizeSplitter(cx, cy, iOldWnd_cx, iOldWnd_cy, iCurRow_cy, 1);
a.Format("%02d",iOldWnd_cy);
b.Format("%02d",cy);
c.Format("%02d",iCurRow_cy);
d.Format("%02d",iNewCurRow_cy);
MessageBox("iOldWnd_cy: "+ a + "\ncy: " + b + "\niCurRow_cy: " + c + "\niNewCurRow_cy: " + d,"in: SIZE_MAXIMIZED " ,MB_OK);
m_Splitter_Main.SetRowInfo(0, iNewCurRow_cy , 0);
m_Splitter_Main.RecalcLayout();
}
else if((!m_Splitter_Main.m_hWnd && nType == SIZE_RESTORED))
{
m_Splitter_Main.GetRowInfo(0 ,iCurRow_cy, iMin_cy);
iNewCurRow_cy = (int)ResizeSplitter(cx, cy, iOldWnd_cx, iOldWnd_cy, iCurRow_cy, (1));
a.Format("%02d",iOldWnd_cy);
b.Format("%02d",cy);
c.Format("%02d",iCurRow_cy);
d.Format("%02d",iNewCurRow_cy);
MessageBox("iOldWnd_cy: "+ a + "\ncy: " + b + "\niCurRow_cy: " + c + "\niNewCurRow_cy: " + d,"in: SIZE_RESTORED " ,MB_OK);
m_Splitter_Main.SetRowInfo(0, iNewCurRow_cy , 0);
m_Splitter_Main.RecalcLayout();
}
CFrameWnd::OnSize(nType, cx, cy);
}
double CMainFrame::ResizeSplitter(int cx, int cy, int iOldWnd_cx, int iOldWnd_cy, int iCurRow_cy, int iZahl)
{
double iNewCurRow_cy;
double iDiff;
double iFaktor;
CString ccc;
CString ddd;
CString aaa;
CString bbb;
iDiff = cy - iOldWnd_cy;
iFaktor = iDiff / cy;
iNewCurRow_cy = (iCurRow_cy * ((iFaktor)+(iZahl)));
return iNewCurRow_cy;
Many, many thanks !
Best regards !
Croc
|
|
|
|
|
Wrong board Croc!
Visual C++/MFC[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Oh sorry
Croc
|
|
|
|
|
7. Given the class definition
class A
{
public:
//constructors
// other members
private:
int x;
int y;
};
Give declarations of operator functions for each of the following ways to overload operator+ you must state where the declaration goes, whether within the class in the public or private section or outside the class. The operator + may be overloaded
a. as friend function
b. as member function
c. as non-friend, non-member function
I have exam from next week and this one of the ques in sample paper .please help me to solve it.
|
|
|
|
|
If it's really urgent, please post it on the correct board[^].
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
charusood wrote: please help me to solve it
No. You should have been paying attention in class.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hello again!
I got an "undefined reference" again, but I don´t know why!
Maybe someone could help me!
The compile-command is:
g++ -o headerblub.exe main.cpp header.cpp blub.cpp
Here´s the code:
main.cpp:
#include "header.h"
int main(int argc, char **argv)
{
HeaderTest h;
h.headerH();
return 0;
}
header.h:
#ifndef HEADER_H
#define HEADER_H
namespace Headerns
{
#include "blub.h"
}
class HeaderTest
{
public:
void headerH();
};
#endif
header.cpp:
#include "header.h"
void HeaderTest::headerH()
{
Headerns::blub();
}
blub.h:
#ifndef BLUB_H
#define BLUB_H
void blub();
#endif
blub.cpp:
#include "blub.h"
#include <iostream>
using namespace std;
void blub()
{
cout << "Hurra" << endl;
}
</iostream>
Thanks a lot!
Stefan
|
|
|
|
|
First, you're on the wrong board.
Visual C++/MFC[^] is for non-managed C++ questions.
Second, why would you #include a file within a different namespace?
I don't have g++ so I can't try your code.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
oh, I´m sorry. I´m new here and I don´t have an overview about the board yet.
I have to include the file in a namespace for a project I´m working on. But I found out the sollution by changing the blub.cpp into:
#include "header.h"
#include <iostream>
void Headerns::blub()
{
std::cout << "Hurra" << std::endl;
}</iostream>
|
|
|
|
|
Here's what I'm talking about...
This makes usage difficult and error prone:
namespace Headerns
{
#include "blub.h"
}
Why should you have to always remember to wrap the #include in
a namespace?
Why not do this instead:
#ifndef BLUB_H
#define BLUB_H
namespace Headerns
{
void blub();
}
#endif
#include "blub.h"
#include
using namespace std;
void blub()
{
cout << "Hurra" << endl;
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am using Visual C++ NET 2005,
I have create one form called "User".
After some handling, in my Solution Explorer, I don't see again my Designer interface (User.h[design]).
But User.h and User.cpp files exist.
How can I view again My design Interface ?
I don't Understand This problem
modified on Wednesday, October 8, 2008 1:38 AM
|
|
|
|
|
Have you tried closing the designer, recompiling your code, and then re-opening the designer? If this doesn't work, could you provide some more details? When you try to view the designer, do you get any particular error messages?
|
|
|
|
|
I have do it: to close the program ad to open again, when I click on design interface I have I red cross with this message(it is not exactly the same words but the same idea ):
Your design interface can not be open due to error. To fix it your rebuild the project or correct codes.
Why in this version, we have this kind of problem ?
|
|
|
|
|
your form class should be first class in the namespace, if there is other class before your form class, move that class.
Nigah M Manzoor
|
|
|
|
|
This is probably far too late, but wanted to add this for the record - I had a similar problem and solved it by clicking on the h file in question, look in the 'properties'window on the right and set the 'File Type' to 'Form' (somehow it had been reset to 'h file'
|
|
|
|
|
I'm writing a transformfilter with 1 input and 2 output pins. I've derived my Transformfilter from CBaseFilter and the pins from CBaseInputPin and CBaseOutputPin. I'm pretty sure my Filter works because if I've only 1 Pin the sample process how it should, but if I add the second output pin the video stops with the first sample on one window a shows nothing on the second window.
When I debug the second time i call GetDeliveryBuffer i get the error code -2147220975.
Here is what i did in the method Receive:
hr = pOutputPin1->GetDeliveryBuffer(&pOutSample1, NULL, NULL, 0);
hr = Copy(pSample, pOutSample1);
hr = Transform1(pSample, pOutSample1);
hr = pOutputPin1->Deliver(pOutSample1);
pOutSample1->Release();
hr = pOutputPin2->GetDeliveryBuffer(&pOutSample2, NULL, NULL, 0);
hr = Copy(pSample, pOutSample2);
hr = Transform2(pSample, pOutSample2);
hr = pOutputPin2->Deliver(pOutSample2);
pOutSample2->Release();
What am i doing wrong?
|
|
|
|
|
You may get an answer, but generally DirectShow questions
don't get much love here.
I know there's a couple MVPs that really know this stuff....you can
find them here:
MSDN DirectX.Video Newsgroup[^]
Hope that helps!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi itchy,
I see you're getting a little help over on the other board.
I was just thinking, if you're delivering the same samples to both
output pins, why not just use a single output pin into an infinite tee filter?
Just a random thought,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yeah I'm getting help, but up until now nothing is working.
I know I could use the inftee filter, but I don't want that because I'm making changes to both samples. If I use inftee filter I need to write 2 filters.
Besides its good practice, if it would work .
Thanks by the way for redirecting me.
|
|
|
|
|
|
Please post on the Visual C++/MFC board[^].
This board is for Managed C++/CLI questions only.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have a Managed C++ Windows Forms program that I'm compiling in Visual Studio 2003. When I try to run it, it tells me "Program too big to fit in memory" in a command prompt.
Does anyone know why it would even pop up with a command prompt window when this is a Windows application? Secondly, why would I get this error? Sources from google tell me that usually, this has to do with a corrupt installer issue, but this is not an installer at all.
Thanks.
|
|
|
|
|
I think I might've found the issue. I believe it lies with trying to reference an unmanaged lib (not compiled with managed extensions in C++), from a project that is compiled into a managed executable (managed extensions enabled). From what I've read, it seems to me (so far) that the only way to do this is to use a .dll and PInvoke, but is there any way to simply use a .lib?
|
|
|
|
|