|
Ok, InternBuffer is set to char*
initialised via "InternBuffer = var_t;" and NEVER used...
InternBuffer = var_t; --> makes problem
//InternBuffer = var_t; --> no problem
Sometimes i have some strange error that i think there is a huge bug in my whole project
|
|
|
|
|
char** => char* should do the work.
Wouldnt it be easier to give the MyCEdit a public char[] member?
Greetings from Germany
|
|
|
|
|
Nice idea,
i will try it, so i need to write at the code
mytextbox.Value
Thanks
|
|
|
|
|
Hi,
Am displaying some label controls, and a list control in a dialog bar. The label controls are there for the user to select colors. When the user selects some five rows in the list control, and selects any of the label controls, i need to color those selected five rows with the color of the label control selected. how to achieve this?
With Regards,
Sangeetha.
|
|
|
|
|
Did you use of NM_CUSTOMDRAW on your project? I think Michael Dunn has a good article about customize list control ?
|
|
|
|
|
Hi
I need to call OnBconnect() event somewhere in my application initialisation so that i do not need to press the button "Connect".
void CRantView::OnBconnect() <br />
{<br />
UpdateData(TRUE);<br />
m_sConnectSocket1.Create();<br />
m_sConnectSocket1.Connect(m_strIP1,m_iPort1);<br />
GetDlgItem(IDC_BCONNECT1)->EnableWindow(TRUE);<br />
}
The idea is that i automatically connect to the socket.
But i get an error something like UpdateData() called before DoModal...similarly for GetDlgItem()
which would be the right place to call this connect-function?? I had tried in View's constructor where i got this error...
|
|
|
|
|
Lose the call to UpdateData() . It'll only add to your frustration.
Is CRantView derived from some CView class? If so, you can't call OnBconnect() method until the view has been fully rendered (e.g., in OnUpdate() , which is called by OnInitialUpdate() ).
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It is derived from CRecordView and i m facing this problem becauce of UpdateData() and GetDlgItem().....when i comment these two lines it works fine.....
You said: until the view has been fully rendered (e.g., OnUpdate()).
When are all these functions UpdateData(),GetDlgItem(), fully rendered??
|
|
|
|
|
Overwrite OnInitialUpdate() and call your functions after the base-call.
Greetings from Germany
|
|
|
|
|
Dear KarstenK,
I tried calling OnBconnect() in OnInitialUpdate().....it worked....Thanks
|
|
|
|
|
According to MSDN, the first parameter to CDC::DrawDragRect() is lpRect and it "specifies the logical coordinates of a rectangle"
However, when I pass in a pointer to a rect in logical coordinates, (DC mapping mode not in MM_TEXT) it draws the rect as if it were treating the rect as if it were in device coordinates.
I can draw a "Rectangle()" with the same rect using the same DC and that rectangle comes out as anticipated.
Is there a misprint in the MSDN and should the rect for CDC::DrawDragRect() be in device coordinates?
|
|
|
|
|
CDC::DrawDragRect() uses PatBlt() to draw the drag rect. If you directly call PatBlt() on the DC
do you get the same result as CDC::DrawDragRect()?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Anything I draw explicitly in logical space is coming out fine on my viewport. The mapping mode results are good for general primitives and blitting operations.
It wasn't that I couldn't provide my own implementation for DrawDragRect(), it was just that I was entertaining the idea that I might be missing something obvious as I'd rather use functionality thats already provided so my peers don't crucify me for reinventing the wheel.
I wasn't sure if it was well known that MSDN incorrectly states the word "Logical" or if that in fact is what it's supposed to do and I had something goofy in my code causing me to chase my tail.
Anyway, I'll play with some patterns and see what I get.
Thanks.
|
|
|
|
|
You could step into the call and see what's different than when you draw
it yourself.
I didn't see anything in there that changes the mapping mode but I didn't
do a runtime test.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
Sorry, but I just began learning C++ (I have better experiences in Java, PHP). Can anyone tell me how I can add GDI+ functionallity to my existing VS2005 C++ based project?
I've already searched for hours and everbody is just telling how to use the Classes right away but is missing the first step... yeah I know, maybe it's to simple, that's way. But I don't know it yet. I tried with adding System.Drawing.dll somehow to the project, but it didn't work.
Thanks in advance
Shi
|
|
|
|
|
I'm not sure about VC++ 2005, but in VC++ 2003...
(NOTE: this assumes native code)
// In stdafx.h
#include <gdiplus.h>
using namespace Gdiplus;
#pragma comment(lib, "GdiPlus")
// Somewhere else in app. Timing is important
// (i.e. don't call too early)
// I usually call it in an MFC app in the
// CDocument constructor with a boolean in
// the app to prevent multiple initialization
// attempts.
// Member in CWinApp or somewhere if not MFC app
ULONG_PTR m_gdiplusToken;
GdiplusStartupInput gdiplusStartupInput; // local variable
if (GdiplusStartup(&m_gdiplusToken,&gdiplusStartupInput,NULL)==Ok) {
// Ready to go
}
|
|
|
|
|
thx, intelli sense seems to work now. I hope the stuff will compile fine also
How can it be that there is no good microsoft tutorial that explains step by step how to do this.. like adding the header files to the folders, the *.lib stuff etc.?
But thx! I'm a step further
|
|
|
|
|
i want to add a new item menu whenever user right click a image file saved on hard disk. The right click context menu of windows explorer bar for the file should show a new item with the name upload to 123greeting and also want an event handler for it.
Make sure it should be for windows explorer and not for internet explorer.
pls help me out
Thanks in advance.
Dhiraj
Dhiraj Kumar Saini
|
|
|
|
|
You have two options
1. to write a shell extension refer http://www.codeproject.com/shell/shellextguide1.asp[^]
2. You can manually add a menu for file type. Take explorer ->Tools menu->Folder options->File type-> select the file type you want, click advanced. add new menu "123greeting". select your application that you want to run when user clicks that menu. The Filename will be passed to that application via command line
|
|
|
|
|
I send a command to a machine once, to which it sends out continuos data output. So OnReceive() event gets triggered. Now my problem is i need to set a timeout duration for this continuous string i receive. For e.g: if i do not receive any string for 2 secs then I display a MessageBox()
How can i achieve this??
Found this example on msdn but how do i execute these lines continuously?
DWORD dwStart = GetTickCount();<br />
if( GetTickCount() - dwStart >= TIMELIMIT )<br />
Cancel();
|
|
|
|
|
try to use this
clock_t start,end;
start=clock();
end=clock();
while((start-end)/1000<2);//2 means 2 seconds
messagebox("time out");
//try this out i used it in most of my applications
|
|
|
|
|
Dear Chandu,
This wouldnt suit my application.
What i m trying to do is that if OnReceive() of Winsock doesnt get triggered every 2 secs then i display the message box.
What you are doing is, you are setting start and stop somewhere(maybe in some function)...so if this funtion never gets called then i cant detect a timeout...
i hope you got the problem
|
|
|
|
|
Why don't you instead start a timer with a timeout of 2 seconds ? Then, in your OnReceive function, you can kill it and restart a new one.
And in the OnTimer function, you display your message box (the OnTimer function will only get called when the timer fires).
|
|
|
|
|
Dear Cedric,
Thanks for your suggestion. I am new to using timers but i reckon that this is what i would need to solve my problem(since a 'time-out' will trigger an event and that's what i want). If wrong then please correct me. I havent yet tried using 'timer'(stuck up with something more critical) but i have to within the next 1 day.
Thanks...
|
|
|
|
|
As Cedric Moonen said, you can set a timer. For a socket there will be a window assiciated with it.That window is a member of the structure_AFX_SOCK_THREAD_STATE; you will be able to get a pointer of that structure using _AFX_SOCK_THREAD_STATE* pState = _afxSockThreadState;
|
|
|
|