|
Hi,
Could any one help me to fast my search on Linked list application. Is there any method to search on linked list. Now i am searching by getfirst and getnext function to retrieve the next node datas.
Regards
Rajesh.
|
|
|
|
|
For faster searching use indexes and binary search algorthm
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
If you want to keep a linked list you won't search very fast, unless you add some other data structures with it.
I'd suggest data hashing (order 1 search with a good algorithm) or AVL trees, which are better than binary search trees but require more work.
Andrew
|
|
|
|
|
Hi Andrew,
Could you provide me more information about AVL trees, it will be great if you provide me some samples.
Thanks
Rajesh
|
|
|
|
|
i am doing a projec based on broadcasting.it means simultaneously passing the message to all the clients in the intranet.ie;server broadcasting the message to all the clients.got to do it in the windows platform ie;vc++.
IF ANYBODY COULD SEND ME THE SAMPLE SOURCE CODE IT WILL BE A GREAT HELP .
|
|
|
|
|
Chaps,
I am using ADO to read and write from a MySQL database. The date in MySQL is stored as YYYY-MM-DD, but when I read the date back using ADO it gives it to me as YYYY/MM/DD. Also, the date in MySQL will always have leading zeros for Month and Day (ie 2004-09-01), whereas ADO gives me 2004/9/1.
My question is, not matter what format the date is in the database I am connecting to, will ADO always give it to me as YYYY/MM/DD without leading zeros? I am not sure if this is a standard feature of ADO. If not, how can I get a standardized way of dealing with date and likewise with times? The program I am writing needs to work on different language operating systems. I ALWAYS want the date in format the database deals with. Is there a simple way of getting round this?
Any help would be much appreciated.
Graham.
|
|
|
|
|
I don't think the RDMS or ADO is the concern. You need the returned date presented to you in a particular format. This you can do depending on the data type that the date is being returned.
If your ADO class is returning a COleDateTime type, then its very easy to format the date to your style, or locale.
For example:
<code>
..
COleDateTime dt;
CADORecordset rs;
..
rs.GetFieldValue(1,dt); <font color=green>
cout << (LPCTSTR)dt.Format(_T("%Y-%m-%d")) << endl; <font color=green>
cout << (LPCTSTR)dt.Format(_T("%d/%m/%Y")) << endl; <font color=green>
</code>
I Dream of Absolute Zero
|
|
|
|
|
Hi,
I am trying to develop a driver installer.
the total softwar has the following :
1. two device driver
2. the main application
The main application requires DirectX 9.0.
I need the installer to automatically install the device driver with or without the device pluged in. It should also
check the DirectX version and install it if the existing version is lower.
Also can u pls tell me wat software can i download that can make the installer?
i heard of visual installer which is free. is there any ohter software that can help me accomplish the above task? and how can i do that(especially the directX checking part)
Thanks a lot..
"Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
|
|
|
|
|
Can anyone please tell me how i can use two buttons to input a pulse on pins 12 and 13 on the parallel port? I have connected an LCD screen to the parallel port and got it to display, but i need it to display a set sentence when I press a button.
|
|
|
|
|
|
To Hello,
I created another view derived from CView using claswizard.
Somehow the other view cannot recognise the data in the CDocument file.The command "pDoc->m_data" where m_data is declared as a public menber in the doc file failed to compile.
Please advise.
Thanks
S1189216G
|
|
|
|
|
Hi,
Firstly see if have have casted the Document object with your document class.
And if you are trying to create multiple views then better practice is store the address of CYourDocument class into your view class.
Cheers
Mitesh
|
|
|
|
|
To Mitesh,
In my project using VC 6.0, I created another class using classwizard with CView as the base class.
In the created class OnDraw function, the function failed to recognise CDocument data members. Any examples?
Another question.
Why cannot declared the View class(XView, with the X being the project name) in the frame file, but it is possible with CView.
S1189216G
|
|
|
|
|
Hi,
If you are replacing your original view class then its fine. But only precaution you should take is, in CXApp class properly map your view class while instanciating your CSingleDocTemplate class in InitInstance method.
If this is done properly then in OnDraw of CXView you should be able to get your document class.
CXDoc* pDoc = GetDocument();
Also, I hope while retriving document pointer you are creating the pointer to your document class and not CDocument class.
HTH
Cheers
Mitesh
|
|
|
|
|
To Mitesh,
Sorry for any misunderstanding caused.
My project has 2 view class.One created by the application,the other by me.
The created view class OnDraw function cannot recognise the CDocument data menbers. It register a compilation error with the statement that the variable is not a member of CDocument.
Thanks.
S1189216G
|
|
|
|
|
Hi,
Thanks for clarification ,
Well as I told you, declare the variable of type CXDocument and not CDocuement (where X being the name of your project).
And if you are doing the same then try declaring CXDocument class on top of your .h or .cpp file where you are using it.
See if this solves your problem or in other case, if you can attach your code snippet then will be in better position to comment on it.
Cheers
Mitesh
|
|
|
|
|
To Miteh,
How do you attach a code in codeproject?
In the doctemplate, the view has a pointer to the document through the function GetDocument().
In my created view the function GetDocument() was also included. There was no complain with the ASSERT command. Why is it so?
How was the pointer created between the application view and document?
Thanks.
S1189216G
|
|
|
|
|
Hello,
First of all sorry for late reply,
Regarding GetDocument() function, just check the variable type (is it CDocument or CXDocument [where X = project name])
Regarding attaching the code, I doubt that you can attach your code files here. But what you can paste the code snippets. That is best way to share your problem.
And further if you want to send any code files then you can directly mail me at mitesh.patel@patni.com
ASSERT will not give any error because, calling GetDocument() method is absolutely valid.
So send the following code sinppets:
1. CApp:InitIntance()
2. CYourView:OnDraw()
Cheers
Mitesh
|
|
|
|
|
To Mitesh,
Thanks for your reply.
Had managed to get the answers to my problem after many hours of trail and errors and readings.
Besides the normal, any tips or links on becoming an expert on MFC?
S1189216G
|
|
|
|
|
I try to build arabic Interface Database syatem , but when i type arabic keys in the text box or any where in the visual c++ 6 , the result is rabush
(misunderstandable keys )>
please tell me how can build Arabic Interface
thanks
|
|
|
|
|
Hi,
Did you set the default language for Non-unicode application to Arabic in "Language & Regional Setting?"
Hope this help
|
|
|
|
|
How can I get the selected item of a runtime modified HMENU item ? Think of for example IE and favorites...
what I want is the number of the selected item.
|
|
|
|
|
I have a C++ program which uses DAO to create an MS Access database - ut has run quite happily on 100s of pcs for years but now it produces this error when it trys to create the database:
"The Jet VBA file (VBAJET.dll for 16-bit versions, or VBAJET32.dll for 32-bit versions) failed to initialize when called. Try reinstalling the application that returned the error."
Any ideas how to fix this?
|
|
|
|
|
Hello dear brother programmers
Can anyone help me in writting a simple windows driver. I want a tutorial in writting drivers because this is my first time writting a driver.
If you can help me with some links and tell me how can I write one of these drivers unde Microsoft Visual C++ 6.0. What do I need to write a driver and so on .
I am trying to design a very efficient firewall and I know that with drivers it is the most efficient way
gabby
|
|
|
|
|