|
Thanks for your answers. I tried and it works, but with some problems. If I make the window smaller, the scrollbars appears. but if i resize a column so much, that it is out of the window, the Scrollbars doesn't appear. It seem that the window only recognizes the initial size of the CListCtrl. I guess that I have to change another property, but I don't now the beast.
modified 15-Apr-22 21:01pm.
|
|
|
|
|
I have data in the form of structure.
I have to send data(structure) from server to client.
Can anybody answer to my query
Oye
|
|
|
|
|
What's the question?
Did I miss something? Hidden content? Read between lines? lol
Regards
|
|
|
|
|
If your structure contains only plain data (no pointers), you can simply send it the standard way (I think you need to pass the address of the structure). If it contains pointers, you need to send everything separately and the contents of the pointers too (and then 'reassemble' everything at the other side)
|
|
|
|
|
I have structure like this
struct
{
int len;
char data[4092];
}filestruct;
where len is the length of file and data is the data of file.
I have to send filestruct from server to client.
Since send()function takes char buff,len when passing ,so how to pass the stucture
Did u get me clearly.
OyeDec
|
|
|
|
|
OyeDec wrote: Since send()function takes char buff,len when passing ,so how to pass the stucture
In general, you simply pass the address of the structure that you cast into a char*. But in your case that won't work because data is a pointer so only the pointer will be passed (only the address), not the contents. You need to first send the len, then the data. Something similar to this (pseudo code):
struct MyStruct;
send(....,(char*)&len,sizeof(int));
send(....,data,len);
So, you don't send your 4092 bytes but only what is needed. At the other side, create a new structure and fill it with the received data (this is left as an exercice for the reader ).
May I ask you why you don't use strings from the Standard Template Library ? It is much more easy to manipulate than char arrays...
|
|
|
|
|
Here i want to send the whole structure and release(free) the structure soon after sending.
I can't go for strings,b'coz i'm passing the image file .
Oye Dec
|
|
|
|
|
Hello,
In a document- view architecture I want to pass a parameter to the document class before the view's ONInitialUpdate is called.
Through the menu which gives a dialog box I get the parameter.I want to pass this parameter to the document class How do I do it?
How to call a parametrized constructor of the document class once I get the parameter from the menu's dialog.The dialog's DoModal() function belongs to the View class.
Thanks
Prithaa
|
|
|
|
|
I know ip address of a remote computer, how can I get its computer name?
I took about 20mins to find it but no luck.
Thanks in advance
|
|
|
|
|
Read chapter 8.6 (gethostbyaddr() ) in This[^] document
|
|
|
|
|
Can i add both bitmap buttons and background color to a caption bar.As a whole can i customize the caption bar.
|
|
|
|
|
Hi,
Yes you can. You can do any painting in non-client area with help of WM_NCPAINT (MFC's OnNcPaint) message.
Regards
|
|
|
|
|
ya i have no doubt with adding back ground color to the title bar.But i am not able to add bitmap button to the title bar(coding).Can you help me out in this?
|
|
|
|
|
Instead of creating a button control, you can use DrawFrameControl(...) to draw a button in its various states and react to the cursor position to determine if the user is attempting to click that button.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
When I use GDI+ ,I Set the Mapmode to MM_LOMETRIC in OnPrepareDC of the View
. the code of OnDraw like below,but the "TEST" is seted to reverse and mirro .
very surperisely !
CXXView::OnDraw(CDC* pDC)
{
using namespace Gdiplus;
Graphics graphics(pDC->GetSafeHdc());
CRect rect(600,-700,800,-900);
const PointF p((rect.left+rect.right)/2,(rect.top+rect.bottom)/2);
GraphicsPath gp ;
RectF rf(rect.left,rect.top,rect.Width(),-rect.Height());
gp.AddRectangle(rf) ;
FontFamily fontFamily(L"Arial");
Font font(&fontFamily, 24, FontStyleBold, UnitPoint);
StringFormat stringFormat;
stringFormat.SetFormatFlags(StringFormatFlagsDirectionRightToLeft);
RectF fontRect(rect.left,rect.top,rect.Width(),-rect.Height()) ;
WCHAR str[] = L"TEST";
gp.AddString(str, (INT)wcslenstr),
&fontFamily,FontStyleBold,36,fontRect, &stringFormat);
SolidBrush solidBrush(Color(0, 0, 0, 0));
Pen pNewPen(Color::Black,3);
graphics.DrawPath(&pNewPen,&gp) ;
}
|
|
|
|
|
Hello Friends,
What is object slicing in c++ ? Why this feature used in c++ ? Is any advantage of object slicing in c++.
Kindly Help.
-PHIJO MATHEW PHILIP.
PHIJO MATHEW PHILIP
|
|
|
|
|
It's not a feature, it's more because you pass a polymorphic object by value instead of passing a pointer to it. So, your object is truncated and you have unexpected results. So, we cannot say that it has advantages
See at the bottom of this page[^] for more info.
|
|
|
|
|
Hi
I'm doing some finishing touch for my project, mostly improving the GUI.
My project is an SDI of Windows Explorer style with a tree view on the left.
The items in the tree correspond to e.g computers, some active and some idle. I want to have these active nodes blinking but I don't know how to do it, more specifically how to change the image of an tree item in run time.
I have think of one way: Using a timer, delete the node and reinsert it with different image when there is WM_TIMER. This way seems to work but it leads to some problems I don't want. More over, my program must run fast and stable so I don't want to use any kind of activeX, just MFC or Win API.
I've just run into VC++ for 1 month (although I have programed C++ on linux for years) so my question may be a little bit silly. please help me
thanks
|
|
|
|
|
Instead of deleting and readding the item, simply change its icon (you ARE using icons, right?) and redraw the item each time the timer fires, alternating between two or more icons (more icons can be used to animate a particular item).
If not using icons, you can use the TVIS_DROPHILITED and/or TVIS_BOLD item states to make the item itself flash. Look-up the TVITEM structure for more details on those states.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Hello Friend,
Can I call virtual fucnction from default constructor ?
Kindly see the C++ code given below
#include <iostream>
using namespace std;
class A
{
public:
A()
{
show();
}
virtual void show()
{
cout <<"virutal function inside the default constructor" << endl;
}
};
int main()
{
A obj;
return 0;
}
What is the techinal advantage and disadvantages of call virutal function from the base class defualt constructor ?
Kindly mention the place where this condition is used in c++ .
Kindly help.
-PHIJO MATHEW PHILIP.
|
|
|
|
|
The short answer is yes, but I would advise against it. A virtual method will propegate down to the derived class. But when you call the derived class' c'tor it will initialize the base class first. So, in the derived method, if you are relying on any members being initialized, they won't be. This may lead to hard to spot problems later in your code.
Pseudo code:
call derived c'tor<br />
call base c'tor<br />
initialize base members<br />
call virtual method<br />
use un-initialized derived member<br />
initialize derived members
|
|
|
|
|
Unless it is qualifid with the current class name, correct?
You can 'force' the virtual function of a specific, known baser class, to be invoked as long as you are at least derived from said baser class.
That would be safe.
|
|
|
|
|
Anything is safe as long as you know what you are doing. In the case of the poster though, it's not wise to baffle him with technicalities while he is just starting on the basics. Later, after he has got the basics under his thumb, is when he will start breaking the rules and pushing his code as far as it will give
|
|
|
|
|
|
Hello friends,
In operator overloading concept in c++ ,certain operators such as
sizeof : sizeof operator
. : membershsip operator
.* : pointer to member operator
:: : scope resolution operator
?: : conditional operator
cannot be overload in c++ , why it so ??
What is the technical reason behind it feature in c++?
-PHIJO MATHEW PHILP.
-PHIJO MATHEW PHILP.
|
|
|
|