|
Dear Pallini, Thanks to your reply.
DMASTER
|
|
|
|
|
Hi All
I use the following piece of code to search an item in a list control by its name and if found delete the item. I got these information from MSDN documentation
<br />
LVFINDINFO info;<br />
int nIndex; <br />
info.flags = LVFI_STRING;<br />
info.psz = cStrGroupName;<br />
<br />
while (-1 != (nIndex=m_lStCtlStationList.FindItem(&info)) )<br />
{<br />
m_lStCtlStationList.DeleteItem(nIndex);<br />
<br />
}<br />
Is there any way i can search a Subitem in a list control and if found i want to delete the entire item from the list control
Thanks and Regards
RK
|
|
|
|
|
AFAIK there isn't a direct function to find subitems: you have to iterate on all items, use
GetItemText http://msdn2.microsoft.com/en-us/library/cbtzx5b1(VS.80).aspx[^] to retrieve subitem text and compare it with the searched string.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Hi,
I want to read a very large text file (size in GB), and have to store in a different format of my convenience. How to overcome the memory problem? And also how to access the stored file fastly. Any suggestions?
Thank you in advance,
With Regards,
Sangeetha.
|
|
|
|
|
Buffering, my friend, buffering is the solution. The size of the buffer is up to your needs.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Hi Pallini,
Thank you for your reply. Sometimes the file size might be 5-10 GB or more than that. So if we create a file in our convenient format, then the size may get doubled. Is there any way to create a file or store the data, so that the size may be smaller?
With Regards,
Sangeetha.
|
|
|
|
|
I cannot understand your needs, do you need file compression?
Please elaborate.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Hi,
Actually my work is to read the given file (size might ranges from 5-10 GB) and to store in my specified format, and then i have to access that stored format for further progress of my project. The thing is the input file itself in larger size, so if i stored the input file in my specified format then its size becomes double. so what can i do for this? which will be better, whether storing the modified data of the file in another file or shall i have to use any other format for storing? and also when i am accessing the stored content, the speed should be fast. I hope that am clear to some extent. if not, please.. i will explain again..
With Regards,
Sangeetha.
|
|
|
|
|
It will mostly depend on what the contents of the input file are and the required output is. It would be good if you could provide an example of both files.
Thanks and Regards,
Zuber
|
|
|
|
|
HI,
I had given one example of how the input file will be, and how i have to gather the information from the given file.
The input file contains the information in the following format,
#10
1 SN1
0 SN2
#15
0 SN3
x SN1
1 SN2
#50
0 SN5
0 SN1
In the above given format,
#10, #15, #50 are timestamps
SN1, SN2, SN3, SN5 are signal names
0, 1, x, are logical values
From the above example, i have to gather information like SN1 is changing at #10, #15, and #50. and the logical values are 1, x, 0. Likewise, have to gather all the information of each and every signal. From the gathered information, in future, if i refer one signal name, i could be able to retrieve all the relevant information (i.e., timestamps, and logical values) of that corresponding signal name. So i need all the information for future reference. So suggest me the best way to store the information.
Gathered information from above example,
SN1 10 15 50
1 x 0
SN2 10 15
0 1
SN3 15
0
SN5 50
0
With Regards,
Sangeetha.
|
|
|
|
|
I want to put the image in memory onto the screen in an appropriate size.
Found that a coordinate transformation made a fuzzy image.
In OnSize, the size tranformation will occured frequently. It needs a better performance.
Another solution is always prepare the Image object in memory as large as what will be drawn onto the screen. It also has a problem, when size of the client changed frequently, the memory Image should be redrawn frequently.
How to make the representation of the image clear and the performance good.
Thanks.
modified on Tuesday, December 25, 2007 1:58:37 AM
|
|
|
|
|
Hello All,
I want to Deploy my MFC Activex Control by Web browser. So what are the DLLs that i need to include in my package?
Thanks in advance.
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
Check with Dependency Walker
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks for reply.
But i want to know what are the basic DLLs that we need to run MFC Activex Control(Not coded for any application, only just control).
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
do you mean the mfc dll's. if so dependency walker will help you get the details or do you mean, that there are 3rd party dll's that you are calling in your code.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I want to save a 24 bit bitmap's RGB data as a file.I firstly import it to resource editor.
void CReadView::OnDraw(CDC* pDC)
{
CReadDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
int i,j;
int counter=0;
BYTE data[640*480*3];
CBitmap bmp;
bmp.LoadBitmap(IDB_BITMAP1);
bmp.GetBitmapBits(640*480*3,data);
BITMAP bitmap;
bmp.GetBitmap(&bitmap);
for(i=0;i<bitmap.bmHeight;i++)
for(j=0;j<bitmap.bmWidth;j++)
{
pDC->SetPixel(j,i, RGB(data[counter],data[counter+1],data[counter+2]));
counter+=3;
}
}
The result is not correct.
|
|
|
|
|
|
Hi,
I am a little confused as to the sequence of events that occur when Thread is Created and The TLS API('S) are called
First CreateThread APi is called the if any DLL's are loaded
BEFORE the Function in the CreateThread API get control the DLL_THREAD_ATTACH message is sent
Now if Want to know What the parms are in CreateThread API
Can I use the TlsAlloc function and TLSSetValue fuction in the Process/thread
So when DLL get control it would know what parms or information are on the CreaThread API By Doing A TLSGetValue function ???
|
|
|
|
|
You could do that - but you don't really need to.
You use the TLS API for "global" variables, that need one instance for each thread - e.g. the variable that stores the value for GetLastError(). Typically, a library allocates a block of memory for all these thread-separate variables.
You could store the parameters in global variables - you would need TLS only if different threads concurrently create new threads.
My question, of course, is different:
Why do you need the information in your DLL, and what are you trying to accomplish?
|
|
|
|
|
I modifying a C MSVC makefile solution I added my own project to this solution which has only 1 project a C makefile project
Whereas my Project is a C++ MFC project
Most of the code for this proect is in 3 Classes The First one
has only one instance where as the others have multiple instances
IS it possible to store the Address of the Object Via NEW in the TLSSetValue ??? for the Class?object which has multiple instances
This would give me a Way of connecting the Thread with the DLL
|
|
|
|
|
Yes, ypou can. In fact, you don't even need to handle the DLL_THREAD_ATTACH notification:
static int slot = TlsAlloc();
CMyState * GetThreadState()
{
INT_PTR value = TlsGetValue(slot);
if (value == 0)
{
CMyState * state = new CMyState();
TlsSetValue(slot, (INT_PTR) state);
return state;
}
return (CMyState *) value;
}
Note that this sample omits all error handling. Especially in (1) TLS slots may already be exhausted, in which case you need to fail gracefully. TLS slots are a very limited resource, so you should use one and only one and only when you really need it. So you'd better design an extensible data structure for your use (rule: play nice wiht others). Also, (2) may throw or return a NULL depending on your memory error handlign settings.
You must, however, handle DLL_THREAD_DETACH (or another "thread is terminating" mechanism) to free the objects you created.
|
|
|
|
|
One more important thing I need to know When Executing CreateThread
What gets Control First The thread stating procedure
or
DLL_ATTACH_THREAD
Thankx
|
|
|
|
|
In answer to this question before, I was advised to look at http://msdn2.microsoft.com/en-us/library/8kche8ah.aspx, which is titled "Determining Which DLLs to Redistribute". It lists these nine DLL's: atl90.dll (Active Template Library); msvcm90.dll msvcp90.dll msvcr90.dll (C Runtime and Standard C++ Libraries); mfc90.dll mfc90u.dll mfcm90.dll mfcm90u.dll mfcmifc90.dll (Microsoft Foundation Classes). But of these nine I can only find msvcm90.dll msvcp90.dll msvcr90.dll anywhere in my folder tree c:\Program Files\ .
The page http://msdn2.microsoft.com/en-us/library/8kche8ah.aspx has at top right corner a window saying "This page is specific to Microsoft Visual Studio 2008/.NET Framework 3.5"; but that page's text also says "As you use DUMPBIN or depends.exe to view your dependencies, use the file list in Redist.txt to see which of the DLLs that your application depends on are Microsoft-supplied DLLs that are part of Visual Studio. Redist.txt is located in the Program Files\Microsoft Visual Studio 2005 directory on the second Visual Studio 2005 product CD or on the DVD.". There seems to be a contradiction here. Please where can I find accurate information?
I tried using a dependency checker, but it listed dozens of .DLL's as needed; presumably most are in Windows and therefore in everybody's computers, and it would be like finding a needle in a haystack sorting through that lot.
I could presumably run the compiled program on another computer to see which DLL's the program needs; but buying a second computer for such a purpose is expen$$$ive.
modified on Monday, December 24, 2007 5:33:11 PM
|
|
|
|
|
Anthony Appleyard wrote: I could presumably run the compiled program on another computer to see which DLL's the program needs; but buying a second
Yeah Probably $ 75.00. You're looking for a Low Spec Machine in order to encounter those problems, so buy a cheap one. If it's too slow to be usefull, does not realy matter. All you want to know is, Does it work at all, and are all required System/MFC DLL's present!
I am familiar with the problem, and have always taken the following approach:-
- My code does not depend on bespoke applications (e.g MS Word etc) to work.
- I work on the lowest level platform that my app is supposed to be supported by. For instance, a current app I am developing is supposed to run on anything from Windows 98 upwards. As a consequence I develop it on a Win98 O/S. Upward compatibility is generally never a problem. i.e. what I write will run under Windows XP
- Where extensions are needed, e.g. In my Current case Named Pipes (Not supported under Win98) I first try to find out from Microsoft what redistributables are available to implement a feature. At least that gives me a List to keep note of, and you know what to include in your package.
On most occasions however, this line runs into the sand. In that case I write my own extension DLL which I own the copyright to, and can freely distribute. This extension DLL is carefully designed to provide the same functionality as the API I want to emulate.
Taking this approach, I found that code generally works without fretting about which System DLL's to distribute with it.
I feel that this problem most often occurs where a developer develops code on a top of the range machine, and sells to customers whith machines not quite so good.
Motto: Make sure you develop on the lowest spec machine that you expect to be supported, and you discover the problems at development stage rather than at the customer support stage. And, believe me, most DLL Distribution questions and problems will either not occur at all, or, if they do you will face them piecemeal during development.
Hope this is helpful
Bram van Kampen
|
|
|
|
|
You should need just 3 of those DLLs - one from each section,
depending on how your project is built...Unicode/non-Unicode,
multithread/single thread.
The easiest solution is to use the redistributable installer
that comes with the VS version you're using.
If you want to just ship the DLLs your app needs, follow the links at that
page you linked to and study carefully.
Those DLLs you need are NOT in the program files folder. They are installed
as side-by-side assemblies in the Windows/winsxs folder. You'll want to
understand how that side-by-side stuff works and how your app's manifest
helps with the DLL versions at runtime.
Have fun
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|