|
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
|
|
|
|
|
|
Does anybody have a simple "Roll the Dice" program?
I just need to get my hands on some working code to study.
I have been trying to build this program on my own but I get tripped up when trying to implement other functions besides main. I am a beginer, what can I say
-Thanks
Mark
As you journey through life take a minute every now and then to give a thought for the other fellow.
He could be plotting something.-Hagar the Horrible
|
|
|
|
|
---Mark--- wrote:
I am a beginer, what can I say
There's nothing wrong with that. We were (and still are in many ways) all beginners at one point.
While I don't have a working program, I can give you a hint to get you going: use the rand() function to obtain a random number. Restrict the random number to the interval [1..6] by using the % operator.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Still working on my program.
And here is what I got so far:
#include <stdio.h>
#include <stdlib.h>
void showone();
void showtwo();
void showthree();
void showfour();
void showfive();
void showsix();
char getans();
void printlines(int n);
main()
{
int r;
char ans;
ans = getans();
while(ans== 'y')
{
r = rand()%6 + 1;
printlines(2);
if (r==1) showone();
if (r==2) showtwo();
if (r==3) showthree();
if (r==4) showfour();
if (r==5) showfive();
if (r==6) showsix();
printlines(2);
}
printlines(2);
}
char getans()
{
int ans;
printf("Throw y/n ?");
ans = -1;
while (ans == -1)
{
ans=getchar();
}
return ans;
}
void printlines(int n)
{
int i;
for(i=1 ; i<=n ; i++) printf("\n");
}
void showone()
{
printf("\n * \n");
}
void showtwo()
{
printf(" * \n\n");
printf(" * \n");
}
void showthree()
{
printf(" * \n");
printf(" * \n");
printf(" *\n");
}
void showfour()
{
printf(" * * \n\n");
printf(" * * \n");
}
void showfive()
{
printf(" * * \n");
printf(" * \n");
printf(" * * \n");
}
void showsix()
{
int i;
for(i=1 ; i>=3 ; i++) printf(" * * \n");
}
The problem I am having is I can't figure how to make it loop back to the y/n. How it is now it goes on forever. How can I make it ask "Throw y/n" each time?
Thanks
-Mark
As you journey through life take a minute every now and then to give a thought for the other fellow.
He could be plotting something.-Hagar the Horrible
|
|
|
|
|
Try changing
ans = getans();<br />
<br />
while(ans== 'y')<br />
{<br />
...<br />
}
to
while(getans()=='y')<br />
{<br />
...<br />
}
That should make it ask the question each time.
|
|
|
|
|
Hi,
Try doing this:
void showone();
void showtwo();
void showthree();
void showfour();
void showfive();
void showsix();
char getans();
void printlines(int n);
void main()
{
int r;
char ans;
srand( (unsigned)time( NULL ) );
ans = getans();
while(ans== 'y')
{
r = rand()%6 + 1;
printlines(2);
if (r==1) showone();
if (r==2) showtwo();
if (r==3) showthree();
if (r==4) showfour();
if (r==5) showfive();
if (r==6) showsix();
printlines(2);
ans = getans();
}
printlines(2);
}
char getans()
{
int ans;
fflush(stdin );
printf("Throw y/n ?");
ans = -1;
while (ans == -1)
{
ans=getchar();
}
return ans;
}
void printlines(int n)
{
int i;
for(i=1 ; i<=n ; i++) printf("\n");
}
void showone()
{
printf("\n * \n");
}
void showtwo()
{
printf(" * \n\n");
printf(" * \n");
}
void showthree()
{
printf(" * \n");
printf(" * \n");
printf(" *\n");
}
void showfour()
{
printf(" * * \n\n");
printf(" * * \n");
}
void showfive()
{
printf(" * * \n");
printf(" * \n");
printf(" * * \n");
}
void showsix()
{
int i;
for(i=1 ; i<=3 ; i++) printf(" * * \n");
}
Regards,
Mahadevan
|
|
|
|
|
What does the fflush() function do?
Thanks
-Mark
As you journey through life take a minute every now and then to give a thought for the other fellow.
He could be plotting something.-Hagar the Horrible
|
|
|
|