|
|
char MyChar='a';
m_MyTextBox.Format("0x%x", MyChar);
UpdateDate(FALSE);
In this case, m_MyTextbox is your member varible with variable type CString to attached to TextBox.
A. Riazi
|
|
|
|
|
Hiya I have only started to learn SQL in MFC/C++. I have a program that opens a ACCESS DATABASE and I can do queries on it no problem using SQL - using CDatabase and CRecordset. My question is how is a SQL server accessed??
Is it the same as I have accessed the ACCESS DATABASE?? Normally on a SQL server, are the files all kept as databases and that is how you can access them the same??
Can anyone give me some info on accessing a database on a SQL server..
Thank you.
grahamoj.
|
|
|
|
|
Basically, the answer is yes, it is the same. In days gone by
(Visual C++ 6.0) a separate set of classes were used for access
called DAO classes, specifically CDaoDatabase and CDaoRecordset,
however those are no longer "supported" in Visual C++ .Net.
However, Access is an ODBC source, which is what CDatabase and
CRecordset use. Consequently, Access works with these classes.
SQL Server (and MSDE) also are ODBC sources. To access them you
need to do one of two things: either use the wizard to generate
the classes and select the SQL DSN as the data source, or
alternatively open the database with the appropriate DSN for
the SQL Server database.
HTH.
|
|
|
|
|
hi,
i'm having problem getting odbc to retrieve paragraph of text from a ms access.. whenever, odbc attempts to read the paragraph text, it alwasy crash.. however, i have no problem storing the paragraph text into the database.. anyone know any solutions?
thanx in advance!
|
|
|
|
|
Have you the Exception handling built in and working? ->Message leads to error.
Is there a supplied buffer for text and the data type right, there a some tricky things in this way
Try this @ home. (B&B)
|
|
|
|
|
When I try search-and-replace text in certain C files with Visual Studio.NET, I get a message box with a red X, the title "Microsoft Development Environment" and the message "Catastrophic failure". The development environment DOES NOT crash and if I repeat the search-and-replace, it seems to work.
Is anyone else seeing this? Any idea what's causing it or how to avoid it? I get no hits on the Knowledge base when I search the knowledge base on "Catastrophic failure visual studio".
Also, I can't find anywhere in the Visual Studio Help or on MSDN about submitting a bug report (searching for "Bug report" "Visual studio" on MSDN returns no relevant hits) and there is nothing about submitting bug reports on the "Visual Studio," "Customer Support," or "Contact Microsoft" pages at MSDN. If anyone from Microsoft is reading this, are you interested in bug reports and if so, how does someone find out where to submit them?
|
|
|
|
|
I am not real clear on using structure statements and external function calls. I am getting the following errors when I compile the file below. Can someone hlep? Thanks.
cinterface3.cpp(22) : error C2228: left of '.start' must have class/struct/union type
cinterface3.cpp(24) : error C2664: 'CreateThread' : cannot convert parameter 3 from 'void (long *)' to 'unsigned long (__stdcall *)(void *)'
cinterface3.cpp(30) : error C2228: left of '.time' must have class/struct/union type
#include <stdio.h>
#include <string.h>
#include <windows.h>
struct io {
char time[10];
int start;
};
struct io cio;
extern "C" __declspec(dllimport) void _stdcall FTREND3
( long * );
void main (void)
{
DWORD tid, cio;
HANDLE hThread;
cio.start = 1;
hThread = CreateThread(NULL, 0, FTREND3, &cio, 0, &tid);
CloseHandle(hThread);
printf("In c after fortran thread started\n\n");
printf("string = %s\n",cio.time);
}
|
|
|
|
|
Two errors here:cio is a DWORD , seems like you meant it to be a io :
DWORD tid;
io cio; FTREND3 does not have the interface expected by CreateThread , as it accepts a long * where CreateThread wants a void * . In this particular case, you can simply force the cast:
hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)FTREND3, &cio, 0, &tid);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
Hello,
Does anyone know how I can cause a VC++ to link additional obj files into a build? That is, obj files that were not generated by the build and are not part of a library. I would prefer not to have to resort to using the command line which looks something like this:
link \OUT:fname obj/*.obj altpath/*.obj
Thanks for any help.
John
|
|
|
|
|
Just add it to the project as you would with a regular .cpp file.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Did you try specifying your obj as external library?
P.S. I assume those obj files were generated by MS compiler
|
|
|
|
|
Both of your suggestions have worked. Thank you both very much.
John
|
|
|
|
|
Hi,
1/I use CCalendar (OCX)
I would like to disable the calendar but it doesn't work.
Can you help me ?
2/ I would like to use cmonthcalendar but when I click to a day when I show the date, the date is wrong.
Why ?
Best Regards
youssef
|
|
|
|
|
This is a simple question, I'm sure you have the answer, help me out please.
I have a List control in my dialog, to which I associate a member variable of CListCtrl. The style of this control is:
General: Visible, Tab stop
Styles: View-Report, Align-Left, Sort-None,
Single Selection, Edit Labels, No column header, Show selection always
More Styles: Border
Extended Styles: Static edge.
In the OnInitDialog, I had the following:
m_myListCtrl.InsertItem(0, "item 0");
But when the dialog is displayed, nothing in the list control!
What am I missing?
|
|
|
|
|
sigh, it turned out that I have to do more overhead work:
m_myListCtrl.InsertColumn(0, "First Column", LVCFMT_LEFT, nWidth);
m_myListCtrl.InsertItem(0, "my item");
beats me!
|
|
|
|
|
hi,
this is what we do.. as
m_List.InsertColumn( // Ask Mfc to create/insert a column
0, // This is the rank/order of this
// particular item
"Name", // The caption we want for this header
LVCFMT_LEFT, // The relative position we want the
// items under this header to have
100); // The width we want for the items under
// this header
m_List.InsertColumn(1, "Profession", LVCFMT_CENTER, 80);
m_List.InsertColumn(2, "Fav. Sport", LVCFMT_LEFT, 100);
m_List.InsertColumn(3, "Hobby", LVCFMT_LEFT, 80);
and to add items..
provide some items to display under the headers:
int nItem; // This integer will be used to identify the
// header item we are dealing with.
// Give a name/caption to an item to display under the first header
nItem = m_List.InsertItem(0, "Sandra");
// Create a caption for the corresponding headers.
m_List.SetItemText(nItem, 1, "Singer");
m_List.SetItemText(nItem, 2, "HandBall");
m_List.SetItemText(nItem, 3, "Beach");
i hope so you get..why you were getting an error..
cheers
Himanshu
|
|
|
|
|
Thank you, Himanshu. I got it now.
This list control is more complext to use than those combo box and edit control.
|
|
|
|
|
Yes first you have to insert columns, then you can insert rows as items. Finally you can set each columns values for that new item : InsertColumn, InsertItem, SetItem for each column...
Hope it helps,
JM
Earth > Europe > France > Lyon
|
|
|
|
|
Hi
I'm having problems with splitter windows and transferring data between the panes. I have split my window in 3, one a CEditView, and the other two are CViews. Now I want to transfer the text I type from the CEditView to the CView, but I'm stuck with this! What should I do???
Regards
Jef
|
|
|
|
|
|
I don't know if i messed up with the code but no UpdateAllViews doesn't seem to work.. I'm even unable to get the document from my custom CView classes, though i included the *doc.h!!!.. .. I'm thinking about something as i'm writing: does i need a document for each view i create??? It can't be, right??
Jef
|
|
|
|
|
Use the CDocument as a bridge between all views (provide it with some members for this kind of info) and use UpdateAllViews .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
hi all,
i have to develop a remote shell like Windows Explorer
but it should have HTML interface..
please help me..
|
|
|
|
|