|
how to use tabbed dialog activex control.how to set properties of this control at run time.how to set dialog or propertysheet for tab in this control.
plz give sample code.
|
|
|
|
|
hi,
I am using picture control and created a control variable for it.. i need to set bitmap programatically by using the control vareiable i created ..
any idea on how to do it... ?
and can it be done by setbitmap()?
Harsha
|
|
|
|
|
If you have a static you can set bitmap with SetBitmap for this control,Is this your question ?
|
|
|
|
|
i have two bit maps to be displayed on two different conditions on a same picture control.. my question is how we can do it ?
Harsha
|
|
|
|
|
Do you want to show two bitmaps(two status) where you want to change this status when you click a button?then use of SetBitmap.(if isnt your answer can you more explain,please)
|
|
|
|
|
Thanks whitesky its working with setbitmap
Harsha
|
|
|
|
|
You're welcome
|
|
|
|
|
If you have the bitmap in the resource, create an object of CBitmap . call LoadBitmap function of it and then pass this obejct to SetBitmap function
If you want to load the bitmap from the file, use the LoadImage function. It will return the handle of HBITMAP, Attach it to CBitmap object and then pass this object to the SetBitmap function.
nave
|
|
|
|
|
ya thanks its working
Harsha
|
|
|
|
|
I have to implement a string search in an excel file. can I some examples regarding this.
S.Yamini
|
|
|
|
|
Give me your exact requirement and the platform or tech
which u are going to apply so that i can help.
thank you
|
|
|
|
|
I have to implement a string search in an excel file. can I some examples regarding this.
S.Yamni
|
|
|
|
|
What sort of search you require, explain a bit. then i am ready to
give you the sample or how to do it.
|
|
|
|
|
CString str;
char ch[6];
str="yamini";
ch=str;
In this I am trying to transfer the string in str to ch buffer.
S.Yamini
|
|
|
|
|
CString str;
char ch[6];
str="yamini";
ch=str;
strcpy(ch, str.GetBuffer(str.GetLength()) ); //Use this to cpy to buffer //Check the length
//or if u have ch as char* ch
//then ch = str.GetBuffer(0); //This code just points does not give a copy
//Let the allocation be dynamic
|
|
|
|
|
This works great.Thanks. I want to learn automation inVC++. Can u plz suggest some links or books.
S.Yamini
|
|
|
|
|
hi,
I am trying to develop a programme to let the user key in their name, then compare their name to the input file i have created using a notepad.
Can anyone suggest me how to check the name key in by the user to the names in the input file?If the name input were the 20th name, then how do i find it from the list? Do i need to use looping?
Another thing if i were to set let say in the same name list, for the first 5 person they need to do certain experiment. For the next 5 they need to do another different one. Then how do i do that?
The programme which i am trying to develop is some sort like a programme to identify the user and hence tell them what class do they need to attend,when,where.
THANKS.
-- modified at 9:10 Tuesday 3rd April, 2007
|
|
|
|
|
tanchinchee wrote: Can anyone suggest me how to check the name key in by the user to the names in the input file?
I don't see clearly the problem but wouldn't strcmp[^] work ? You just have to compare the strings, right ?
|
|
|
|
|
I have used strcmp before this. But let say i have 20 names in my list and the name input is the 20th name. i don't know how to search for it in the list. I can only obtain the first name from the list. Do i need to use looping? If yes how do i do it? And what is the use of the command EOF(End Of File)? Can you show me how to use it if it might be applicable in my project. Thanks.
p/s: Sorry i might not know many things as i am a beginner. But thanks for the help. Thanks...
|
|
|
|
|
Well, the problem is in fact not a single problem: you are asking quite different things so let's decompose everything.
In general, the best way to deal with these kind of situations (meaning, you have a file containing information that you need to access 'often) is to read the file once and store everything in memory.
1) How to store the data in memory ?
It looks like you have an undefined amount of data (names in your case) to read from the file. So we will need a kind of array to store this information. Two options: either you use the standard C++ arrays (using new[] operator) or you use a container class from the STL. I suggest the container from the STL: it is much more powerfull and flexible (and does all the memory management for you) but if you are a beginner, it might a little bit tricky at the begining (hopefully, there are quite a lot of tutorials). I recommand using the std::list in your case. Here[^] is a tutorial for example, but using google you can find a lot. Honnestly, it is worth the time to learn how to use it, you'll see in the future that it is very very helpfull.
What you could do is to have a structure for each entry of your file (that contains all the info about one person). Then use a std::list of these structures.
2) How to read data from the file ?
Now that you know how to store data in memory (more or less at least), you will need to read your data from the file. Here, it is difficult to help because I have absolutely no idea of how the data is formated in your file. If you could post a short example of the file it would be helpfull.
But again, you read each entrey one by one and for each of them, you fill a structure (the one explained in point 1) and you add it in your list. You continue until you reach the end of your file (EOF).
3) How to retrieve data from your list ?
That's not very difficult once you are familiar with the std::list. You can simply loop through your list until you find the information that you need.
Also, what you could do is using a std::map instead. It store in fact the data with a certain key so that you can easily find it afterward (with only the key).
Hope that helps, it is quite a broad subject so it is too long to enter in the details. You'll need to work a little bit by yourself.
|
|
|
|
|
Well, that's quite some useful information. Following is the example of list in my programme :
I have an infile("C:\\test.txt")
the infile looks like this:
No Name Student id
1. Tan Chin Chee AD051810
2. Lim AD051819
3. Daniel AD051010
Well, how do i find the name Daniel and view which class does he need to attend?
(Lets say the first person needs to attend a Dynamics class, the second needs to attend a Thermo class while the third one needs to attend a Math class)
I am also facing a problem where i do not know how to set a different situation(to attend which class) for each person in the same list. Do i use looping as well?
|
|
|
|
|
tanchinchee wrote: 1. Tan Chin Chee AD051810
This will be a problem to handle: you have three words (they are separated by a white space) for the name...
Maybe what you could use to encode your data is xml, so your file will look like this:
<list>
<student Name="Tan Chin Chee" Id="AD051810">
<AttendingClass Name="Dynamics">
<AttendingClass Name="Thermo">
</student>
...
</list>
This will make things much more easier and you will be able to add things quite easily (like schedules for the classes or other information about your student). But of course, this will require to understand a little bit how xml works (but for these kind of things it is really really easy).
If you choose to use xml, you can find here[^] a nice xml parser.
|
|
|
|
|
Another thing. I have been trying to use the following source code to compare the input name from the user to the name store in the database but fail. Can i know what is the problem?
#include <iostream>
#include <fstream>
#include <cstring>
void main()
{
char n1[20],n2[20];
cin>>n1;
ifstream infile("C:\\test.txt");
infile>>n2;
while(n1!=n2)
{
infile>>n2;
if(strcmp(n1,n2))
cout<<"False";
else
cout<<"True";
}
}
Well, it turns out to be an infinite loop. Why is that? And how do i change it?
|
|
|
|
|
tanchinchee wrote: Well, it turns out to be an infinite loop.
Yes, that's normal. Simply because of that:
while(n1!=n2)
What you are comparing there is two pointers (you don't compare the contents of the string but the pointers). These pointers will always point to a different address, even if the two contents are the same.
You need to compare the strings, not the addresses:
while(strcmp(n1,n2))
But as you are already doing that inside the loop, it would be better to rewrite the loop in such way:
while(strcmp(n1,n2))<br />
{<br />
cout << "false";<br />
infile>>n2;<br />
}<br />
cout << "true";
In fact, you will only print true when the two strings are the same so when you exit the loop.
By the way, when you post code, use the pre or code tags (just above the emoticons).
|
|
|
|
|
why no one is answering for the threads posted. since last week i am not getting a good response. pls help me i am need guidance for tree control. i am new to this.
-- modified at 1:51 Monday 2nd April, 2007
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|