|
Now, I can display different language string using TextOutW() function, such as Portuguese and Traditional Chinese. However, when I print them, such characters there are just blank???
I don't know why? Help me, please!
Thank you for your kindness first.
Any comment is welcome!
|
|
|
|
|
You also need to select a font into the DC that supports the character sets used by the foreign languages.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
I am writing a c++ .exe MFC program, using a library written in C code.
from the C code, I want a message box to pop up when an error has been detected. I tried using MessageBox function but it says too few actual parameters. The function prototype the MessageBox function is:
int MessageBox(
HWND hWnd, // handle to owner window
LPCTSTR lpText, // text in message box
LPCTSTR lpCaption, // message box title
UINT uType // message box style
);
does the problem lies with the hWnd handle? how can i get the handle to the window from the library in C code?
Pls help.
hearties
|
|
|
|
|
You could pass NULL to the hWnd parameter or use ::GetActiveWindow to attach the box to the current active window
Michael
|
|
|
|
|
Let's say I have a dialog-based program. The main dialog is CMainDlg.
CMainDlg has as members of the class 2 sub-dialogs: CSubDlg1 and CSubDlg2 (or pointers to them).
I would like easy access from within the sub-dialogs to some other members
of the CMainDlg. How do I most easily accomplish this?
It seems that it would be easiest to have a pointer to the CMainDlg as a member
of each sub-dialog class -- but the necessary #include statements seem to
cause a conflict (understandably).
Alternately, it would be nice for each sub-dialog to have easy access to the other
sub-dialog members. So, again, it would be nice for each sub-dialog to have a pointer
to the other sub-dialog as a member of its class. But again the necessary #include
statements fog it up.
Suggestions?
Why?, you ask? One example of why is in using a TabControl. I would like some changes
in information on one page reflected on other pages, so the pages need an easy way
to communicate with each other or with the parent dialog so that it can serve as
a liaison (so to say).
Thanks. David.
|
|
|
|
|
No need to ask why - it's an obvious need
The answer is to create the pointer when you need it, OR to put the #include for the pointer in your .cpp file and in the .h file declare a dummy class. At least that has worked for me, but in this specific case I would just grab it as I need it
CMainDlg * pMain = (CMainDlg*) GetParent(); ( or AfxGetMainWnd())
and away we go. The pointer is fresh out of the box, and the #include is in the cpp file. The only thing is to pass this as the parent when creating the dialog.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
I have used the GetParent() to snag a pointer just like you described. Thanks.
The dummy class... is it as simple as this?
class CMainDlg : public CDialog{}
Or is there more to it than that? (I haven't had a chance to try it out yet).
I like that idea, thanks. That makes it easy to include a pointer to other child dialogs as a member of a
child dialog class -- which is one of my goals, to simplify my life a bit.
BTW, the '#include "std_disclaimer.h' is very funny.
Thanks for the answers. David.
|
|
|
|
|
Hi anyone/Everyone,
Iam writing an application that sends emails using SMTP.Problem is when the application is run as a console application there is no problem.but when run as a win32 service(on win2000) the mail sending gets stuck at the point of sending the mail.I tried setting the smtp to take the local account,system account and mail account bu still the same prolem.
can someone help me on this urgently PLease.
Pramodh
|
|
|
|
|
Is there any way to fill in forms and press buttons on someone else web site using C++ code. For example if I create an application that stores a user name and password. I then open a url that requires my user name and password and it also requires you to push a submit button. Is it possible to have the dialog app auto fill the information and hit the submit button? Does anyone know where I can start looking or possibly have any source code examples?
Thanks,
RobJones
|
|
|
|
|
Hi All,
I have a problem with disconnected recordsets.I ahve a component.One if it's function will get all the Records in a Database.I am passing the Recordset pointer from the server to the Client.I am using disconnected recordsets for this.
I can see that at the server side I am getting the Recordset
pointer.But, I could not get this pointer on the client side.
the function has the protoype
STDMETHODIMP GetAllElements([out]IUnknown **ppRecordset);
I could get the Recordset pointer at the server side, but could not pass it to client.I am using Client side cursor(adUseClient) and standard Marshaling.
what could be the problem .
Thanx in advance for the help.
Regards,
yamini
|
|
|
|
|
Hi,
What DB are you using? I got similar problem with ACCESS Database, But an attempt with SQL Server database was successful.
regards
Mangesh Sardesai.
|
|
|
|
|
Hi,
I am using MS Access DB for maintaining Records.I am using the SQL
Query for getting records from Database.
Please tell me how you did you fix the problem.
Hope this will help.
Thanx,
Regards,
yamini
|
|
|
|
|
I am a VB developer and hence using the VB terminology. So please bear with me.
The disconnected recordset did not worked with MS-ACCESS, the probable reason being,access being a file database, the file is closed as soon as the active connection of the recordset is set to nothing. This behaviour of the provider is be default and nothing can be done about it directly. (i.e. Set rs.ActiveConnection=Nothing wont work)
The only thing you can do is -
1. Return a connected recordset to client process (rs1).
2. Create a new Recordset in client process (rs2)
3. Add exactly similar number & type of fields to rs2 as in returned Recordset(rs1).
4. open recordset (rs2). without any connection or source.This should be dynamic
5. run a loop inside which you will add the records from rs1 to rs2
one at a time.
6. close rs1.
7. use rs2 as you wish
I have developed a small program in VB which you can refer & transpose to VC++.
The database is an access database with a single table "table1" with fields -
No Autonumber
Name Text(50)
===================================================
ActiveX dll
===================================================
Option Explicit
Dim conn As New ADODB.Connection
''''''''''''''''''''''''''''''''
Private Sub Class_Initialize()
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\1.mdb;Persist Security Info=False;"
End Sub
Public Function GetRsData() As ADODB.Recordset
Dim rs As New ADODB.Recordset
rs.Open "table1", conn, adOpenStatic, adLockReadOnly, adCmdTable
Set GetRsData = rs
End Function
========================================================================
========================================================================
The Client Executable
========================================================================
'A simple form with a single button placed & code for button click event
Private Sub Command1_Click()
Dim cls As New Class1
Dim rs1 As New ADODB.Recordset
Set rs1 = cls.GetRsData
Dim rs2 As New ADODB.Recordset
rs2.Fields.Append "No", adInteger
rs2.Fields.Append "Name", adVarChar, 50
rs2.Open "", , adOpenDynamic, adLockOptimistic, adCmdUnknown
Do Until rs1.EOF
rs2.AddNew
rs2("No").Value = rs1("No").Value
rs2("Name").Value = rs1("Name").Value
rs2.Update
rs1.MoveNext
Loop
rs1.Close
Set rs1 = Nothing
rs2.MoveFirst
Do Until rs2.EOF
MsgBox rs2(0) & " : " & rs2(1)
rs2.MoveNext
Loop
'If i halt the execution at this point and check for the active
'connection in debug window then it is found to be nothing.
'i.e ?rs2.ActiveConnection is nothing gives me TRUE!
'And there is your disconnected recordset(though not truely disconnected as it was never connected).
End Sub
I hope the above example would answer your query and help you in solving your problem.
do let me know if you get acheive any another solution.
regards,
Mangesh Sardesai.
|
|
|
|
|
Hi,
Thanx for the Reply.Actually ,I can't get that Recordset pointer at the client side.That is , it points to memory 0x00000000.So, I
could not access the Database using that NULL pointer.
My function at the server side goes this way .
STDMETHODIMP GetAllElements([out]IUnknown **ppRecordset)
{
//Here I am getting the Recordset Pointer.
}
Upto this step I can get the Recordset pointer
At the client side ,
void main()
{
IUnknown *pRecordset;
//Instantiate the Component & get the Interface pointer say pInterface.
pInterface->GetAllElement(&pRecordset);//pRecordset=0x00000000.Code Fails
//Accessing Records goes here
}
How should I pass the pointer if I am wrong at the Client side.
i am doing Standard Library Marshaling here.Is it to do something with this Marshaling !
Thanx in advance for the help.
Regards,
yamini
|
|
|
|
|
I have written an MMC snapin by inserting it as an ATL object in Visual C++ 6.0. However, when I run MMC with the snapin and I try to remove columns from the columns list using "change columns". I am able to remove columns from the "columns displayed" section, but, when I press OK and return to the snapin the column that I removed is still showing as a column header. Has anyone experienced this behaviour before and if so can you tell me how to rectify it.
|
|
|
|
|
Hi !
Contact me by mail and I'll send you a code... It's not easy to describe a solution in forum
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
what event/message occurs whenever i click the x button of the title bar? what i want to do is to display a confirmation dialog box before the application can be terminated. is this possible?
onyok
|
|
|
|
|
You'll get a WM_CLOSE message. Keep in mind you also get WM_CLOSE from ALT+F4 and the Close item in the system menu.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
Hello, the codegurus around the world.;)
We can filter some message to use CDialog::WindowProc function.
And as the previous poster pointed out, check WM_CLOSE message, and which control gets
input foucs or the other method like the mouse position(?)if we close x button of the dialog.
I guess that the function argument will deal with your requierment.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
I'm looking for any class that like the famous Oulook-bar control, is there any good one ??
Thanks much, Honza
|
|
|
|
|
http://codeguru.earthweb.com/controls/outbar.shtml
--------------
"Criticism is often constructive because it makes you feel superior when you give it"
-- Dogbert
|
|
|
|
|
Ok I want to write an application that interacts with a webpage in its CHtmlView..
I want to do the following:
1. Get feedback from the page on mouse-events, buttons clicked,... This I can do
2. Get interactive with the page and call javascript functions from the C++ code... This I can not do! Help!!
Can anyone help me to solve my problem?
thx
Wim Boffé
|
|
|
|
|
Hi,
I'm writing a postprocessor program for visualizing the results from
a Finite Element Analysis (FEA). The program is to be running in a
Windows NT/2000/98 environment.
I have three questions:
1. Is it possible to make a dialog transparent? If not, is it
possible to change the background color of it?
2. I don't manage to change the position of the tabs with the
CTabCtrl. They are on top now, but I want them to be on the right
side. There should be a command TCS_VERTICAL used with TCS_RIGHT but
when I do this, the tabs dont show up at all. Should I do something
extra?
3. I have'nt managed to disable some specific radio buttons on
the different tabs when the a specific solution is choosen (nodal
solution or element solution). When looking at a nodal solution all
radio buttons are to be enabled. But when pressing element solution,
specific radio buttons are to be disabled.
I use the following sequence:
m_first.GetDlgItem(IDC_RADIO101)->EnableWindow(FALSE);
RADIO101 is placed on dialog FIRSTDIALOG which belongs to CFirstDlg.
m_first is a CFirstDlg member. The program compiles, but there is a
runtime error when I press element solution. Any suggestions?
Best regards
Dennis Nilsson
M.Sc. Mech. Eng. Sweden
----------------------------------------
|
|
|
|
|
Question 1: Under W2000, yes. Under everything else there is a transparent flag, but it doesn't do much useful. Changing the background colour is easy - use FillSolidRect in OnPaint or OnEraseBackground
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
I have a dialog with buttons and Listbox control. I know how to set the font of the dialog in Resources, but all controls have to use the same font. Can I set the dialog font in Time New Roman, and the Listbox control uses Courier New?
Thanks
|
|
|
|