|
i have vs2008.
i set the limit by using this code ---
portID.SetLimitText(5);
only numeric problem is left.
modified on Wednesday, July 22, 2009 2:29 AM
|
|
|
|
|
In addition to the above comment, you can use the FindItem() function of list control directly. No need to loop.
|
|
|
|
|
|
LVFINDINFO temp;
CString ff;
temp.flags = LVFI_STRING | LVFI_PARTIAL;
CStdioFile fileh;
fileh.Open(L"C:\\srvc.txt", CFile::modeRead);
int i;
do
{
if(fileh.ReadString(ff)== NULL)
{
break;
}
temp.psz = ff.GetBuffer();
i = m_objListCtrl.FindItem(&temp);
if(lstrcmp(m_objListCtrl.GetItemText(i, 0), temp.psz) == 0)
{
m_objListCtrl.SetCheck(i, TRUE);
}
}
while(ff.GetBuffer() != NULL);
fileh.Close();
This can work in my computer, but I don't guarantee it could work in your computer.
And by the way, I am in school now, but tomorrow I'll back home(There is no computer in my house ). It means I could not use computer for a long time. And I can't solve problem together with you, I'm sorry for that..
|
|
|
|
|
I Now wish to extend my existing XP Program suiteto enable installation into Vista. I do not use Windows Installer, and do not propose to use it. What steps are required to adapt my own installation program, on the basis that neither is registered anywhere.
Regards,
Bram van Kampen
|
|
|
|
|
you need to check dependency of your program
|
|
|
|
|
Hi All:
I'm sure there are a number of you who have gone through this experience in the past, and rather than reinvent a method, I thought I'd ask first. Has anyone converted a large number of static libraries to DLLs using an automated method (or semi-automated)? Is there any advice you would give someone trying to do this for the first time? We have about 20 or so to convert, and ideally we would like to find a method that also allows us to use the conversion information to make *nix dynamic objects as well (but it not a hard requirement).
Regards,
-B
"[F]reedom isn't a licence, it's responsibility." [David Gerrold, Author's Note in "The Man Who Folded Himself", 2003, p. 119]
|
|
|
|
|
Ben Burnett wrote: Has anyone converted a large number of static libraries to DLLs
Yes (well, about 8)
Ben Burnett wrote: using an automated method (or semi-automated)?
Ummm - I created a new solution, with new DLL projects, copied the code across, hacked it around to add the necessary DLL exporting terms and rebuilt. It pretty much worked, IIRC.
Don't forget to use a a DLL based C runtime model across everyhting if you pass around ownership of dynamically allocated objects.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Also, I always use a macro to define the export type of classes and functions so that they can be used in both static and dynamic libraries easily.
|
|
|
|
|
I have a MFC MDI app in C++ and I'm rotating a CImage 90 deg., but trying to handle non-square images. I copy the CImage to a temp. buffer, detroy the CImage, create a new one with the new dimensions and write the pixels back into the new CImage. The problem is the display still is sized for the old image. I think I need to delete the DC and start a new one, but I'm not sure how. Any help would be appreciated. Thanks.
|
|
|
|
|
could you give a code snippet?
Rozis
|
|
|
|
|
Here's some code...
if (nx != ny) {
nx2 = ny;
ny2 = nx;
m_image.ReleaseDC();
m_image.Destroy();
if (!m_image.Create(nx2, -(int)ny2, 32, 0)) {
fMessageBox("Error - CImagrDoc::Rotate()",
MB_ICONERROR, "Failed bitmap .Create()");
return;
}
p = (int *) m_image.GetBits();
}
|
|
|
|
|
I'll guess the next thing you do is changing the bits in the buffer P...
I'm not into C++ but with the following GDI-functions you maybe get the idea. I'll expect you have a handle to the source bitmap and a DC to the screen. Then use CreatecompatibleDC() to create an extra DC. Use CreatecompatibleBitmap() with the desired dimensions as the target bitmap. Now do everything you want with this bitmap and finally BitBlt() it back to the screen. Below a code snippet (not in C++, but i'll bet you can read it) that mirrors a area of the screen horizontally, to give you some idea:
hMemDC2:=CreateCompatibleDC(hdc)
dh:=int(h/2)+1
hbitmap2:=CreatecompatibleBitmap(hmemdc,w,dh)
hold2:=SelectObject(hMemDC2,hBitmap2)
stretchblt(hmemDC2,0,0,w,dh,hDC,x,y+h,w,-(dh+1),SRCCOPY)
bitblt(hDC,x,y-1,w,dh,hmemDC2,0,0,SRCCOPY)
DeleteObject(SelectObject(hMemDC2,hold2))
DeleteDC(hMemDC2)
Helps this?
Rozis
|
|
|
|
|
My code was in the doc. class, so it looks like I will have to rewrite for the view to get the dc's.
|
|
|
|
|
This doesn't seem to be working and from what I've been reading I don't think this will work because CImage gets its own HDC. Do you have any idea how this can be done with the CImage class?
|
|
|
|
|
I just figured out that after I create the new CImage all I need to do is change the window dimensions. So just using this worked:
SetScrollSizes(MM_TEXT, pDoc->GetImageCSize());
GetParentFrame()->RecalcLayout();
ResizeParentToFit(false);
Thanks for the help anyway.
|
|
|
|
|
|
VCD_A wrote: ...I cant install linux, I want a tool that will allow me to execute programs on linux environment...
Is this even possible?
VCD_A wrote: ...linux environment that is on Windows XP, VMware is better option...
But you said you can't install Linux.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
dfsnum[v] = akt++;
gw.set_user_label(v,string("%d",dfsnum[v]));
please help me write the same thing in c++ i am getting errors...!!
|
|
|
|
|
Member 3112447 wrote: please help me write the same thing in c++...
This just does not make any sense. At a minimum, you need to show the declaration of dfsnum , v , akt , and gw . You might also hint at what you are trying to accomplish. The less time we spend guessing, the better off you are.
Member 3112447 wrote: ...i am getting errors...!!
Care to share?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Member 3112447 wrote: gw.set_user_label(...)
That looks awfully like C++ anyway - C doesn't have methods of structs. I suppose set_user_label could be a function pointer in gw...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Stuart Dootson wrote: C doesn't have methods of structs
function pointers
|
|
|
|
|
|
I am using VC++ (MFC application)6.0. In my project i use a dialog box in which 2 Edit boxes are there. The Edit boxes value changes dynamically during the program, but the Edit box do not update the value. The Edit box shows only the last value.
How can I overcome to this problem?
Please help me, i will be thankful for that.
|
|
|
|
|
Sanjeev.Kr.mit wrote: The Edit boxes value changes dynamically during the program, but the Edit box do not update the value.
How can an edit control's value change yet not change? To update an edit control, simply use:
m_edit.SetWindowText("This is my new value.");
...
CString str;
str.Format("I have %d", 5);
m_edit.SetWindowText(str);
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|