|
Hi,
I wants to use more than one base classes in a single project. For example , is i wants to make my application web based then the base class should be CHtmlView. Other than this fecility I want the other fecilites given by some other base class , say CView. How can i achieve this?
|
|
|
|
|
CHtmlView inherits form CView so you can access CView member functions from a class which inherits from CView.
Or do you mean you want two kinds of views, one HTML and one other kind?
Michael
|
|
|
|
|
I think, you mean you want two kinds of class, example one CHTMLView and one CMenu, you can inherit for the two class,
do you know:
CYouClass:CHtmlView, CMenu
{
}
nothing but everything
|
|
|
|
|
I have inhereted a PP application written in VC++6. It has two slides -- slide1 and slide2. At runtime, I may need to add additional sets of these two slides, in the same order as the original two -- something like slide1a, slide2a, slide1b, and slide2b. When I use the Slides collection Duplicate() method, they always come out in this order: slide1a, slide1b, slide2a and slide2b. How can I rearrange the slides in the order I want? I've seen methods that return the slide number but no function to set the slide number.
|
|
|
|
|
where can i find the c/c++ souece code of notepad.exe.detail,please!thanks!
qdash
|
|
|
|
|
Visual C++ and the platform SDK both used to come with notepad/wordpad type application source. Try searching on http:\\msdn.microsoft.com.
Michael
|
|
|
|
|
It is called MULTIPAD, and is supposed to be the MDI version of Notepad.
Regards,
Gennady
|
|
|
|
|
The MFC source for wordpad is also on MSDN.
---
"Transmit in all known frequencies and in all known langauges, including Welsh."
|
|
|
|
|
Hi everyone,i encounter one problem in asp programming.Anyone know the log-out source code rather than using session.abandon.
|
|
|
|
|
This is something I could write, buit at the moment I'm short of tie and it seems someone must have done one by now.
I'd like to do have a dialog with a generic properties list - you know, a two-column CListCtrl that displays property names in one column and values in another, as below:
Name Jim
Height 5'11"
Age 42
Friendly Yes
Hat Off
Shoes On
Again, not too hard, but there are enough details involved in doing it right that I don't feel I can justify the time now. Has anyone done one of these?
|
|
|
|
|
I want to create a programm that would read data from a file and will put each distinct item in a hashtable,counting how often it appears.I want to count first how often single characters or numbers appear,then how often the combination of two characters appear,three characters etc.
More specifically...
How can I use hashtable to count the appearances of some items in a file.For example how often is the letter a used,letter b etc.I am using hashtable.class in java.util.* ,but what I can not do is associate each letter that I am reading with a place in the hashtable.
For example the following code creates a hashtable called numbers with the default capacity and load factor.Then one-two-three are used as the keys and 1-2-3 as the values.
Hashtable numbers = new Hashtable();
numbers.put("one", new Integer(1));
numbers.put("two", new Integer(2));
numbers.put("three", new Integer(3));
I want my hashtable to read a file one character or one number at a time and count their appearances.
The data would most probably be in the form
abc
abcd
a
abce
ecf
e
fg
or
123
12346
12
348
7
2
3456
52
364725
Thanks a lot for suggestions to my previous question as well as to future ones.
jkouris@hotmail.com
|
|
|
|
|
const f = "C:\...\file.txt"
set fso = CreateObject("Scripting.FileSystemObject")
redim count(255)
set ts = fso.OpenTextFile(f)
do while not ts.AtEndOfStream
c = asc(ts.Read(1))
count(c) = count(c) + 1
loop
ts.close
set ts = fso.CreateTextFile(f & ".count")
ts.WriteLine "asc" & vbTab & "chr" & vbTab & "count"
for i = 0 to 255
if count(i) > 0 then ts.WriteLine i & vbTab & chr(i) & vbTab & count(i)
next
ts.close
input: your mail
output:
asc chr count
10 (LF) 37
13 (CR) 37
32 176
34 " 6
40 ( 7
41 ) 7
42 * 1
44 , 8
45 - 4
46 . 19
49 1 5
50 2 8
51 3 7
52 4 4
53 5 3
54 6 3
55 7 2
56 8 1
59 ; 4
61 = 1
64 @ 1
70 F 2
72 H 3
73 I 10
77 M 1
84 T 3
97 a 102
98 b 24
99 c 39
100 d 20
101 e 115
102 f 20
103 g 12
104 h 47
105 i 38
106 j 2
107 k 3
108 l 38
109 m 25
110 n 57
111 o 61
112 p 22
113 q 1
114 r 53
115 s 52
116 t 94
117 u 31
118 v 3
119 w 23
120 x 2
121 y 6
|
|
|
|
|
as i m doing a food ordering programme for cisco ip phone 7960.i have difficulty in sending the data into the correct area of the table i wan.As i m not sending the whole row of data together,i m sending it column by column.but through this method,the data i sent is not of the same row.for each column,the data will in each column will be one row below the previous one,which is not what i wanted.wat should i do to be able to send the data column by column n they will still stay at the same row???
aaa
|
|
|
|
|
Michelle,
Can you give some more detail on what method you are trying to use? I haven't seen the SDK for the Cisco IP Phone 7960 yet.
Cheers!
Colin
|
|
|
|
|
You have to account for your data being sorted differently in each place.
So, your orriginal table may look like this,
ItemID FoodItem QtyStock QtyChanged
100 Eggs 10 Y
101 Cheese 25 N
102 Fish 5 Y
You only want to send the new stock figures rather than the whole table and then only information that has changed, but you need the ItemID sent too so that your receiving program knows which data Item is being changed.
So you send 100,10;102,5
A point with synchronising multiple data sources. If the remote system is purely a view then you do not need to take account of time. But, if your cisco ip (or what ever the remote device is) can also change the data then you need a synchronising policy.
This is nearly always based on time. So the simple table above would be something like,
ItemID FoodItem QtyStock QtyChanged TimeChanged
100 Eggs 10 Y 20/10/01 2:15:02
101 Cheese 25 N 21/10/01 3:35:11
102 Fish 5 Y 20/10/01 2:00:00
Now, when you synchronise your data you need three fields,
send 100,10,20/10/01 2:15:02;102,5,20/10/01 2:00:00;
Receive {any changed data from the remote device}
I just added this part to sort of spur you on. Sorry if I'm rambling. People often accuse me of rambling, I don't see it myself.........
We do it for the joy of seeing the users struggle.
|
|
|
|
|
|
HELLLLLP
I need to obtain the name of the graphics card inserted in my PC.
I'm using C++ and the Windows Api.
I'm totally out of ideas.
David
|
|
|
|
|
Windows Managment Instrumentation will give you that information.
See http://msdn.microsoft.com/library/en-us/wmisdk/wmistart_5kth.asp
Cheers!
Colin Bowern, Consultant
Enterprise Platform Solutions
Microsoft Services (Canada)
|
|
|
|
|
Search for DISPLAY_DEVICE in your help.
Then,
BOOL EnumDisplayDevices(
PVOID Unused, // not used; must be NULL
DWORD iDevNum, // specifies display device
PDISPLAY_DEVICE lpDisplayDevice, // pointer to structure to
// receive display device information
DWORD dwFlags // flags to condition function behavior
);
Will fill the structure with device information.
typedef struct _DISPLAY_DEVICE {
DWORD cb;
WCHAR DeviceName[32];
WCHAR DeviceString[128];
DWORD StateFlags;
} DISPLAY_DEVICE, *PDISPLAY_DEVICE, *LPDISPLAY_DEVICE;
Please note that these are marked as 'Preliminary' on my system so check with the microsoft developers site to ensure there have not changed. Specifically on a Win2000/NT.
We do it for the joy of seeing the users struggle.
|
|
|
|
|
I decided I had better add a warning.
These 'DisplayDevice' functions will link you to the DEVMODE structure and it's functions. Don't play arround with these unless you really know what you are doing, its quite possible to blow your monitor by using incorrect settings.
Though at the same time there is some information contained here that can be used by 'precision graphics' programmers. If you do look at this area then treat it as a source of information rather than a place to change things.
We do it for the joy of seeing the users struggle.
|
|
|
|
|
Hi anyone have the source code on log out in asp.
Thanz
|
|
|
|
|
as there r different types of food in my menu.In order to display it in the browser wat the customer had ordered,i need to program it in the sense that it was sent to their respective columns.For example,when he chose steak,steak was inserted into the field "steak".how m i going to make the program to insert the food into their respective field???
|
|
|
|
|
I don't understand your question. What kind of input form? Are you trying to insert data from a form into a database? You'll need to provide a clearer defintion of your problem if you want to get any useful help.
Michael
|
|
|
|
|
how to compare whether the item is of the same name as the field name...i need to insert the item to the field name which both r the same
aaa
|
|
|
|
|
Come on ginny, we need a bit more of a clue to answer your questions. But I like a challenge so I'll have a go at what I think you were asking.
I guess that you are writing a database application and do not know how to decide what field that data ought to go into from, say an edit box. So, from that I suspect you basically want to know how to design a database.
A database consists of,
the data - a means of receiving/writing the data - one or more views/interfaces.
Lets create a data table first. This is a list of fields and the type of data that field can hold, so we might create a table such as,
Table name = People
Field1 Name=ItemID Type=Long
Field2 Name=Name Type=Text
Field3 Name=Age Type=Integer
In row/column form this looks like
ItemID Name Age
100 Bob 43
101 Sharon 25
The means of receiving/writting to the database can be simple 'hardcoded' or SQL/ODBC. Hardcoded is obviously dependent upon the language you are using.
In VBA (Access) it can be just,
dim dbs as database
dim rst as recordset
set dbs = CurrentDB
set rst = dbs.OpenRecordSet("People",dbOpenDynaset)
with rst
{move to the record you want or .AddNew}
.Edit
!ItemID = NextAvailableID() (or use AutoNumber in Access)
!Name = "Sally"
!Age = 56
.Update
wend
Thats only to give you a starting point. Actually I think Excel/Lotus123 are very good places to learn database techniques in code.
In the 'data input' view, lets assume a simple form view, you would have an edit box for each field that the user can edit.
Edit Box 1 = Name
Edit Box 2 = Age
In this case you wouldn't want the user entering the ItemID since you want to ensure this is unique.
On pressing Enter (or selecting a button) your code updates or creates a new record in the data.
A good way to learn how databases work if your in C++ is to work with your own tables/queries/views. So that you write and experiment with each area in a place where you have full control over it.
So you might start with a simple structure such as,
class CDataNode
{
long m_ItemID;
char m_Name[30];
int m_Age;
};
Then write a class that takes care of lists of this type, avoid making use of the ready made list templates at this point since the whole purpose is to learn how to manipulate the data yourself. But of cause the likes of CMap (and its children) are extreemly usefull later.
class CDataList
{
public:
int AddNode(CDataNode* NewNode);
CDataNode GetNode(int NodeRefference);
{other functions that manipulate your data}
private:
CDataNode **m_ptrToptrOfDataNodeType;
{or for the purposes of the excercise simplify it to}
CDataNode m_MyData[SOME_MAX_NUMBER_OF_ITEMS];
};
Then you would write a view class (or rather put it into a ready made View class.
class CMyView : public CFormView
{
CDataList m_MyDataList;
//other functions that control the interface between the data and the user.
};
As you are working with this you will inevitably come across areas where your unsure if a function is part of the data or part of the view. For example in an accounts program you might have to add TAX to the user edited value. The resulting value goes into the database, but where does the calculation belong, in CDataList or in CView? I'm not going to say, it is up to you, the budding programmer, to work this out.
I obviously haven't written this in full, but you have to do some of the work yourself. Learning how to code is not programming, thats just learning a language. Programming is turning physical ideas in to programatic form, for that you need to excercise your own logic.
We do it for the joy of seeing the users struggle.
|
|
|
|