|
chen wrote:
int MessageBox(CString str);
That's the MFC CWnd version
chen wrote:
int MessageBox(
HWND hWnd, // handle to owner window
LPCTSTR lpText, // text in message box
LPCTSTR lpCaption, // message box title
UINT uType // message box style
);
That's the original API version
chen wrote:
AfxMessageBox(str).
This is a global MFC function
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Is it possible to set timers in a worker thread function? I created an invisible window inside the worker thread function and set timer using that window. When it timed out, it never called the timer procedure.What could be the problem?
RamDili
|
|
|
|
|
Hi,
Pass the Parent Pointer to the Worker thread.
Then you can use the PostMessage(WM_TIMER ..)
using the Pointer of the Parent.
Handle the Message in the OnTimer() function
of the Parent
Regards
Sameer
ramdili wrote:
set timers in a worker thread function
|
|
|
|
|
Hi,
I have created an ActiveX Control which exposes 3
methods
Connect
Disconnect (no arguments)
Send
My Disconnect works fine under ASP, but my CONNECT and
SEND are not working, I have arguments as LPSTR in both
which are [in].
The ASP error is
Automation Variable not supported.
How do i Overcome this problem
Sameer
|
|
|
|
|
I am working on Customdraw toolbars and I have a problem. Perhaps I am overlooking something obvious or trivial but is it possible to render the button separators myself? For some reason they are not included in the CDRF_NOTIFYITEMDRAW notifications
Thanks,
- Jan
|
|
|
|
|
when i have tried to connect my DSN file using the codes below a "Select Database" dialog always screens out. Although i used CDatabase::noOdbcDialog flag when i call Recordset.Open() it again asks me to select the database from the dialog
What should i do next?
Test6DB.OpenEx( _T( "DSN=Test6Spec" ), CDatabase::openReadOnly |
CDatabase::noOdbcDialog );
SpecDBRecodSet.Open(); // It calls my DefaultSQL() and displays a "select database" dialog...
Thanks for ur help...
Atilla Selem
just listening to you...
|
|
|
|
|
1. If you are giving the path to the database in consturcting the database object
then just pass the Database as a param in the constructor to the
recordset object.
2. Specify the path to the database in the DSN(ODBC control panel ..)
|
|
|
|
|
i tried ur suggestion but it failed...
i have a dialog class
and i have my Database and RecordSet objects as member variables.
in my dialog class constructor i created my Recordset object by passing DB object as parameter.
Then i called what i have done in the previous mail..
but again it calls "select database" dialog although i referred my Recordset class to DSN while creating RecordSet class by classwizard.
Do i have a mistake sending DB object in construction?
class CTest6SpecDlg : public CDialog
{
// Construction
public:
CTest6SpecDlg(CWnd* pParent = NULL); // standard constructor
CDatabase Test6DB;
CSpecRecordset SpecDBRecodSet;
..
..
}
CTest6SpecDlg::CTest6SpecDlg(CWnd* pParent /*=NULL*/)
: CDialog(CTest6SpecDlg::IDD, pParent)
{
CSpecRecordset SpecDBRecodSet(&Test6DB);
..
..
other member variables initialization
}
just listening to you...
|
|
|
|
|
When you construct the CRecordset, you need to pass in a pointer to your CDatabase object.
It appears that you are istantiating the CRecordset object before you connect to the database. Try moving the istantiation of your CRecordset below the CDatabase::open call and be sure to pass in a pointer to the CDatabase object through the constructor.
CDatabase db
db.Open("somedsn", someoptions);
CRecordset rs(&db);
rs.Open();
rs.close();
db.Close();
I ommited error checking code for simplicity.
|
|
|
|
|
I use GetAce() function I to get the ACE of file.ACE has some defined types (e.g ACCESS_ALLOWED_OBJECT_ACE ).It is structure that it has a ACCESS_MASK and it is DWORD typedef that contain rights.Now I know how to get the ACCESS_MASK but the problem is that I don't know how can I check a DWORD type.For example I don't know how can I check for bit of 16 or 17 if they are true or not.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
|
Thank you PJ.I'll read it very soon.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Hello everyone,
I want to display the controls on the view class which is not derived from CView.( The application is not using the Doc / View arch.)
Is there any way in which I can load the entire dialog template instead of calling the Create / CreateControl for each control that i want to display on the form?
thanks and regards
|
|
|
|
|
You want to display a view which is not derived from CView What are you trying to do, then? Could you please ellaborate?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Mangesh Sardesai wrote:
entire dialog template
How about CFormView?
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Whats the difference b/w CreateThread and CreateProcess ???
Case1: Suppose in the main program I use the function CreateThread. When i close the main program, the thread associated with the main program automaticaly ends.
Case2: Suppose in the main program i use the function CreateProcess. A new process created ie an external exe may loaded in the memory. Now when the main program terminates, whether child process close with main program like that of threads in Case 1 or not?????
|
|
|
|
|
In Case2, "child" processes do not close when the main one does. Actually, there's no parent-child relationship among a process B created by A with CreateProcess , you can think of them as separate programs without any special dependency to each other.
Anyway, fifferences between threads and processes extend far beyond this issue.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
I have created a simple ActiveX ATL project in VC++,
How do I add member variables in the Object. Its like
I want to store some information that can be accessed
from all my functions.
Thanx in advance
Sameer
|
|
|
|
|
You can add the variables directly to the class if you only want them to be used internally.
However if you want to be able to access these variables externally through a COM interface, the easiest way to add a variable is to go to your class view tab of your ATL activex component workspace. Then right click to get the context menu, and select Add member variable. After you fill at that form, the IDE will modify your IDL file and CPP files to add that variable to your class and COM interfaces.
Good Luck.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Thanx a lot.!!
I have one more Problem. I have Declared a Method as
method([in] LPSTR str, [out, retval] int *retvat)
and when i call this function through ASP, it gives the
error as
Automation Variable not supported.
Please help
|
|
|
|
|
You cannot use the LPSTR datatype if you want your COM objects to be portable outside of C++. You will need to use the BSTR datatype.
Here is a little bit of information about BSTRs.
They are UNICODE strings, so you will have to use the ATL conversion macros to convert between your ansi single character string and the wide char UNICODE string in ATL. Lookup A2W in MSDN and you will find some info about it.
A BSTR is special in the fact that it contains the size of the BSTR encoded in its format. When you deal with a BSTR you are given a pointer to the string portion of the BSTR. However, the 4 bytes preceding that pointer contain the size of the BSTR.
example:
pointer
|
size | string data wide chars
4 bytes V 12 bytes, as the size fild indicates
[12] [\0H\0e\0l\0l\0o\0\0]
You can also use the CComBSTR class in ATL to manage your BSTR variables for you, it simplifies things a lot.
You will also want to become familiar with the ::SysAllocString and ::SysFreeString functions. These are the functions that you will use to allocate a new BSTR.
good luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi,
Thanx for the reply.
Actually I want to pass a string as a paramter from my
ASP code (in the ACTIVEX-ATL component) and in the
component I am using the parameter as a string for
some purpose where I want a char * type
What should i do
Sameer
|
|
|
|
|
Hello All,
I am currently unable to print / print preview properly from my SDI application. I am using a class derived from CSplitterWnd to split my screen up into 4 windows. The left hand window may be switched between 3 different views. I can print when viewing my default view (defined in the document template), but when viewing either of my other views (all derived from CView), selecting Print from the menu does not do anything...
In which class should I define my printing events (i.e. OnBeginPrinting etc) so as to be able to print no matter which view is on display? Is there an easy solution to this?
Thanks in advance. Any help with this will be greatly appreciated
Steve
|
|
|
|
|
|
Thanks Jonathan. This is exactly what I was looking for. Great advice!
Steve
|
|
|
|