|
|
Pls. could anyone help on this:
VC++ 6.0 SP6
I have a list box that can hold 12 lines of strings w/o scrolling. I want
it to scroll up when more strings are added. It scrolls up, but the 13th
through Total items are displayed as line 12. When the loop is done, the
list box refreshes and shows all the correct items. How do I get the 13+
items to show correctly when scrolling? When I step through the debugger,
the string I am adding is correct, but the display isn't.
CListBox *pList;
pList = static_cast<clistbox*>(GetDlgItem (IDC_LIST1));
for(x=1; x<y; x++)
{
...="" lines="" where="" the="" string="" 'sdothis'="" is="" created
plist-="">InsertString (-1, sDoThis);
pList->ScrollWindow (0, -12, NULL, NULL);
pList->UpdateWindow ();
}
---Arun.
|
|
|
|
|
arunperi wrote: pList->ScrollWindow (0, -12, NULL, NULL);
pList->UpdateWindow ();
Why not use CListBox::SetTopIndex() instead?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi All,
Can anyone give me an idea about the Autos or Locals window in the .net 2003 environment.
I am pretty confused regarding that.Is it a list view control or tree view control...
or a tree item in a listview ...
The point is that i need to design something similar to that...
using WTL/ATL (no MFC)
so,plz help me regarding this matter...
Thanks in advance
|
|
|
|
|
i have to download a file which Executable so for this have write code as follows
hConnect = InternetOpenUrl(hConnection,
file_path,
szHead,
lstrlen(szHead),
INTERNET_FLAG_DONT_CACHE,
0)));
do{
if (!InternetReadFile(hConnect, szbuf, 512, &dwSize))
return FALSE;
if (!dwSize)
break; // Condition of dwSize=0 indicate EOF. Stop.*/
if (dwSize < 512)
szbuf[dwSize] = '\0';
file_data += szbuf;
} while(1);
and i am writing "file_data"(which is cstring type) to a file named as *.EXE
but Problem is that , there is file size 66048 bytes but downloaded bytes are '4126' only .
can anybody tell me what is the problem.
Bankey Khandelwal
Software Engineer
|
|
|
|
|
Use URLDownloadToFile .
More[^] Info.
Nibu thomas
Software Developer
|
|
|
|
|
Saving binary files using CString is not a good idea, neither is assigning binary to CString except using one specific constructor of CString . You should save the binary data using the character array.
this is this.
|
|
|
|
|
Is char array safe for the unicode versions..???
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
It depends on what you are doing with it. As for file download, it shouldn't be a problem (never tested it though). For other text handling, it may not be a good idea.
Anyway, you can test it to find out.
this is this.
|
|
|
|
|
Bankey Khandelwal wrote: have to download a file which Executable so for this have write code as follows
try http://www.codeproject.com/internet/simplehttpclient.asp
|
|
|
|
|
Hi all,
How can I show the tooltip at a particular position?
Thank you.
- NS -
|
|
|
|
|
You might want to look at MSDN Magazine -- June 2001, the CPopupText article by Paul DiLascia, (which I use for my mobile tooltips),
or the TTM_TRACKPOSITION tooltip message.
Iain.
|
|
|
|
|
Thank you. I am going to try it now.
- NS -
|
|
|
|
|
Hi,
Im using dynamic buttons to populate each cell in the list control.
And Im using "On_Control_range(ButtonFirst,ButtonLast,OnButtonClicked)" to handle the event of each button. And this means that I need to have a definite value for the "ButtonLast", and its not look like a dynamic anymore because there is a definite number of buttons available.
I declare the ButtonFirst = 6000; ButtonLast = 7000;
Do you have any logic where i dont need to set the last value of button?
|
|
|
|
|
how to decrypt the text which was encrypted and stored in a file using BLOWFISH algorithm
|
|
|
|
|
by knowing the encrypting key first...
|
|
|
|
|
iBlowFish.Encrypt((unsigned char*)szDataIn4,
(unsigned char*)szDataOut4, 96, CBlowFish::ECB);
url.Format ("%s",szDataOut4);
fputs(url,fpa);
fputs("\n",fpa);
this is the way i am putting the encrypted data into the file now i need to decrypy it when ever i click the decrypt button and i should get corresponding user details like am storing username and password details of minimum 85 members
|
|
|
|
|
am storing the username and password details getting the corresponding details and encrpting and storing that in a file
now i need to decrypt and should get the corresponding userdetails whom i select from the list this is the way i am encrypting and storing the data
iBlowFish.Encrypt((unsigned char*)szDataIn4,
(unsigned char*)szDataOut4, 96, CBlowFish::ECB);
url.Format ("%s",szDataOut4);
fputs(url,fpa);
fputs("\n",fpa);
|
|
|
|
|
I'm using the CMonthCalCtrl control in an MFC dialog app, the control seems to work fine if it has the focus at all times, however once I select any other items on the dialog and then try to change the date (using the GUI), then the date although it's displayed correctly when I call the GetDay method in my code the day returned is 3-4 days out
has anyone else came across this?
cheers,
|
|
|
|
|
further to this.
I've created a new MFC dialog and added a calander and a drop down box, I've then added the following code on the SelChange method of the calander along with a break point:
CTime myTime ;
m_Calander.GetCurSel ( myTime ) ;
int day = myTime.GetDay ( ) ;
int month = myTime.GetMonth ( ) ;
int year = myTime.GetYear ( ) ;
running the porgram and selecting different dates on the calander gives the correct results, however as soon as I click on the drop down box and then click on another date on this calander the result is incorrect!
Any ideas?
cheers,
Andy
|
|
|
|
|
sort of fixed this problem, instead of using GetCurSel on the calander do this following:
SYSTEMTIME SelectedDateStruct = { 0 };
DateTime_GetSystemtime( m_Calander.GetSafeHwnd(), &SelectedDateStruct);
this seems to always return the correct values (I got this solution from: http://codeguru.earthweb.com/forum/showthread.php?p=990808#post990808[^]
Andy,
|
|
|
|
|
I have somewhat of a strange problem. I have associated a file type with my app, and set all the registry values accordingly. Double clicking the file opens my app and passes the file and path just as it should. From within my app I then check if the file is there.
WIN32_FIND_DATA fd;
HANDLE hand;
hand = FindFirstFile(filename,&fd);
if (hand == INVALID_HANDLE_VALUE) {
MessageBox(0,"File not found",0,0);
return 0;
}
FindClose(hand);
All this works from within the MSVC environment with both release and debug builds. But after installing the app (program files directory) the findfirstfile() always fails. I have tried placing the file in various locations but it can never confirm that it's there.
Any ideas as to what I may be doing wrong?
|
|
|
|
|
FindFirstFile() etc set of file find functions look in the current directory if the full path to the file has not been given. I am not sure, but are you getting the full path, or just the filename? If you are getting the full path, then you could use GetFileAttributes() etc. Also try some way to find the directory from which the file was dropped onto the app.
this is this.
|
|
|
|
|
yes, I am giving the full path. I have also noticed that it's not only this function failing me, none of my openfile functions are able to find/open files.
It doesn't matter what filetype is passed, anything passed on the command line is not found.
|
|
|
|
|
No worries, the problem was the registry setting. It was set up to pass a quoted argument.
|
|
|
|