|
There's a new feature in VC6 that adds a length param to RFX_Text - it defaults to 255. Class wizard doesn't know about it.
You might try revising the DoFieldExchange code to add this fourth parameter:
pFX->SetFieldType(CFieldExchange::outputColumn);
RFX_Long(pFX, _T("[ID]"), m_ID);
RFX_Text(pFX, _T("[Name]"), m_Name);
RFX_Text(pFX, _T("[Notes]"), m_Notes, 32768);
|
|
|
|
|
Hello all,
I've written a dialog based application that uses several bitmap images on them. I wrote the application with a high resolution (1280 x 1024). Now I'm testing the application on machines with lower resolutions and all of the bitmap pictures don't correctly line up with the components on the form! Shouldn't the images increase/decrease with changes in the screen resolution at the same rate as other form components? It makes the form look really unprofessional, so I would like to figure out a fix for this. Thanks in advance!
--Tale
|
|
|
|
|
No, bitmaps do not automatically scale. How are you placing them ? In your OnPaint, or in a bitmap holder static ? Either way, it would appear you need to write some code to size them according to the size of the other objects on your dialog.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
I'm placing them using a static control. Can you explain the best way to resize the bitmaps? What method do I adjust the bitmaps in?
--Tale
|
|
|
|
|
Hello, can anyone help a beginner in c++? I want to create a database using DAO, accessing data from Microsoft Access. I'm using visual 6, and Microsoft Access 2000. I've done the tutorials using stdreg32.mdb but obviously I want my own data, fields, tables etc. But everytime I create a new database saved as .mdb and I try to create my own exe using the appwizard it just won't accept it, I've tried registering it, I tried the stdreg.exe program. I just keep on running up against walls. Can anyone help me. Please.
Crusty
|
|
|
|
|
Crusty,
I think you will have much less headaches when you do not create a 'bound' MFC application, app created with app wizard that connects to a DAO database.
You will be better off creating and handling your own CDAODAtabase, CDAORecorset, CDAO..., objects. This way you have control what you want to connect to and what to use at run time. Also the CDAODatabase object contains abilities to create a Access database.
Peter
|
|
|
|
|
First, I'm sorry for my English.
Now, I have really big problem for me!
I have two kind of source.
First one is coded with C(which one uses singlethread), and second one is coded with C++( MFC )--(which one uses Multithread).
What I did to make one application, I just open new project with Visual C++, and making a dialog box, some buttons, and just include C codes.
And, I had many Errors! So, I added some statement to use C code in MFC ( extern "C" ... )
But, and then I had real problem.
That is different kind thread can not be use for one application......
So, this is my problem.
How can I solve this problem?
Or, is there any way to make one application with two kind of codes?
please answer me..
|
|
|
|
|
Every C statement in existance is valid C++, so I'd suggest this was not the problem. You should probably put up some code or an example of the sort of errors you are having, it's impossible to give specififc advice without specific problems to solve.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Er, with the addition of stronger type checking of parameters to functions in C++. This can result in a lot of casting patches when compiling C code in C++.
|
|
|
|
|
Hello!
I'm developing a very simple application (using MFC) which all it does is show a splash screen, launch and configure the Internet Explorer UI (I'm using IWebBrowser2 to do that). Now my problem is that i need to eliminate IE's accelerator keys, so that the user can't insert a URL pressing CTRL+O. I would also like to disable IE's right-button pop-up menus. As far as I can see the IWebBrowser2 interface doesn't provide
this kind of functionality.
Can you please, give me some advise on how can this be done?
Thank you very much!
Luís Teixeira
|
|
|
|
|
Hello!
I'm developing a very simple application (using MFC) which all it does is show a splash screen, launch and configure the Internet Explorer UI (I'm using IWebBrowser2 to do that). Now my problem is that i need to eliminate IE's accelerator keys, so that the user can't insert a URL pressing CTRL+O. I would also like to disable IE's right-button pop-up menus. As far as I can see the IWebBrowser2 interface doesn't provide
this kind of functionality.
Can you please, give me some advise on how can this be done?
Thank you very much!
Luís Teixeira
|
|
|
|
|
You have to implement an object that intercept the events from IWebBrowser2. This interface is DWebBrowseEvents(2). This object - I call it sink dispatcher - must implement the interface IDocHostUIHandler. This interface has a method called TranslateAccelerator. Implement this interface leaving all other interface specific method to return E_NOTIMPL ( = "do default") and TranslateAccelerator returning S_OK ( = "let me do it, do NOT do the default"). For disabling popup menus, you have also to implement the ShowContextMenu method (of the same interface) by simply returning S_OK instead of E_NOTIMPL that will let IE to handle the context menu. But first of all you have to get the IWebBrowser2 object (this is simple, since you are telling that the project is MFC) and to call Advise to let your dispatcher object to do the job (that is, in more cases, to return E_NOTIMPL ).
So: I suppose you have a dialog where the WebBrowser control is incapsulated. I can tell you how to eliminate also the resources and to create dynamically the whole stuff.
1) Create a window. [optional, but maybe you want a toolbar, a status bar etc.]
2) Create a dialog (encapsulated in that window, if you did (1)).
3) Implement an interface derived from DWebBrowserEvents2 (let's call it ISinkDispatcher);
4) Implement an interface derived from IOleClientSite, IOleInPlaceSite (optional) and IDocHostUIHandler (for you, mandatory);
5) in OnInitDialog of your dialog, do this (the OLE API way, I don't use MFC a lot):
BOOL
WebBrowser_OnInitBrowser(HWND hWnd)
{
IStorage *pStorage = (IStorage *)NULL;
ILockBytes *pLockBytes = (ILockBytes *)NULL;
IWebOleClientSite *pWebOleClientSite = (IWebOleClientSite *)NULL;
IOleObject *pOleObject = (IOleObject *)NULL;
pWebOleClientSite = new IWebOleClientSite(hWnd);
LPWEBDIALOGDATA lpWebDlgData = (LPWEBDIALOGDATA)GetWindowLong(hWnd, DWL_USER);
lpWebDlgData->pWebOleClientSite = pWebOleClientSite;
CreateILockBytesOnHGlobal(NULL, TRUE, &pLockBytes);
StgCreateDocfileOnILockBytes(pLockBytes,
STGM_SHARE_EXCLUSIVE | STGM_CREATE | STGM_READWRITE, 0, &pStorage);
OleCreate(CLSID_WebBrowser, IID_IOleObject, OLERENDER_DRAW, NULL,
pWebOleClientSite, pStorage, (LPVOID *)&pOleObject);
pWebOleClientSite->m_pIOleObject = pOleObject;
pWebOleClientSite->m_hWndOwner = hWnd;
pWebOleClientSite->ConnectEvents();
pWebOleClientSite->Show();
pOleObject->Release();
pStorage->Release();
pLockBytes->Release();
return TRUE;
}
(The error handling is for you).
6) ConnectEvents should get the IConnectionPointContainer interface of the IWebBrowser2 object, and to FindConnectionPoint with iid = DIID_DWebBrowserEvents2. If succeeded (= have IE installed ) you can create here your ISinkDiapatcher object and call IConnectionPoint's Advise passing your dispatcher. Something like this:
HRESULT
IWebOleClientSite::ConnectEvents()
{
HRESULT hr = E_NOINTERFACE;
IWebBrowser2 *pWebBrowser = (IWebBrowser2 *)NULL;
hr = m_pIOleObject->QueryInterface(IID_IWebBrowser2, (LPVOID *)&pWebBrowser);
if(SUCCEEDED(hr))
{
hr = pWebBrowser->put_TheaterMode((VARIANT_BOOL)1);
hr = pWebBrowser->put_RegisterAsBrowser((VARIANT_BOOL)1);
IConnectionPointContainer *pCPI = (IConnectionPointContainer *)NULL;
hr = pWebBrowser->QueryInterface(IID_IConnectionPointContainer , (LPVOID *)&pCPI);
if(SUCCEEDED(hr))
{
hr = pCPI->FindConnectionPoint(DIID_DWebBrowserEvents2, &m_pConnectionPoint);
if(SUCCEEDED(hr))
{
m_pSinkDispatcher = new ISinkDispatcher;
hr = m_pConnectionPoint->Advise(reinterpret_cast<IDispatch*>(m_pSinkDispatcher), &m_dwCookie);
if(SUCCEEDED(hr))
{
m_pSinkDispatcher->SetClientSite(this);
}
}
pCPI->Release();
}
pWebBrowser->Release();
};
return hr;
}
(Don't forget: if you have a ConnectEvents, do also a DisconnectEvents on dialog close).
In few moments I'll post a sample about this on CodeTools. If these lines above are quite complicated (and I agree), maybe reading sample, building and debugging on your own can be more helpful that these aglomerated lines...
All the best,
Sardaukar
|
|
|
|
|
How to determine the cursor shape. I am interested in a function that returns a CONSTANT of some kind. If not is there an API fuction that returns a bitmap, or a Windows image handle?
|
|
|
|
|
GetCursor.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Hiya
Does anyone know anything about addins for Outlook Express? I've read about doing it using COM for Outlook 2000 but I can seem to find much about how to do it for Express. Any ideas anyone?
Noodle
|
|
|
|
|
Outlook Express has no automation model. As such, you can't create COM add-ins for it.
|
|
|
|
|
Hiya
thanks for the info
I was thinking about maybe using MAPI to get into outlook using an object and creating any toolbars and windows using standard SDK stuff (making the toolbar seperate from outlook). Would this approach be possible?
Thanks
Noodle
|
|
|
|
|
Again, Outlook Express does not expose an automation model. Outlook Express does not use MAPI.
|
|
|
|
|
Hi Erik,
This seems to be common wisdom that EO does not support COM addins/plugins or an object model.I have seen quite a few programs like PGP extend OE and have wondered how they do it? Although external programs can hack into the toolbar/menuitems creation with windows hooks etc, I do believe OE did (does?) have an extensible architecture.
Strange thing is, recently while programming evc with MS embedded tools while goinf thru the PocketPC SDK files,
I came across 2 files msoeapi.h and msoeapi.idl and it definately shows that OE had(has?) an MS Outlook like COM addin architecture.
Has anybody come across these files/undocumented OE Api?
What's going on?
'My capacity for happiness', he added, 'you could fit into a matchbox without taking out the matches first'.
- Marvin, the robot.
Amit Dey
sonork: 100:18407
msn: visualcdev
|
|
|
|
|
Hi
I want to use a timeout value but i don't know. I use only Win32 Api and Winsock 1.1.
Anyone can help me please ?
Thansk a lot
Eric
|
|
|
|
|
I used a timeout for socket connection. It works like this. But note that this is just an example. There may be typing errors and I am sure it can be wrapped to some funtions.
//1 Create a socket
m_hSocket = ::socket(PF_INET, SOCK_STREAM, 0);
//2 Set time out
struct timeval TimeVal;
TimeVal.tv_sec = iTimeOutSecond;//Pass the time out time here
TimeVal.tv_usec = iTimeOutMicroSecond;
//Try to make socket non-blocking
unsigned long ulNonBlocking = 1;
int iResult = ioctlsocket (m_hSocket,FIONBIO,&ulNonBlocking);//Try to set non-blocking
// connects to peer
int r = ::connect(m_hSocket, (SOCKADDR*)&Peer, sizeof(Peer));
fd_set ReadEvent, WriteEvents, ExceptionEvents;
FD_ZERO (&ReadEvent);
FD_SET (m_hSocket,&ReadEvent);
FD_ZERO (&WriteEvents);
FD_SET (m_hSocket,&WriteEvents);
FD_ZERO (&ExceptionEvents);
FD_SET (m_hSocket,&ExceptionEvents);
int iResult = select (NULL,&ReadEvent,&WriteEvents,&ExceptionEvents,&TimeVal);
if ((iResult == SOCKET_ERROR ) || (iResult == 0) ) //Error or time-out
{
return FALSE;
}
I hope it helps.
www.geocities.com/ton_soft
|
|
|
|
|
Watch out for the use of "select". It has been reported not to be very user-friendly, since it can be a bit tricky - things can happen such as it returning from a ReadEvent and not really being read-ready.
Take a look at http://www.cyberport.com/~tangent/programming/winsock/ (Winsock FAQ).
Cheers,
JFC
|
|
|
|
|
Timeout for what? Remember that, for example, "connect" has it's own timeout...
Can you be more specific as to the way you are using your sockets?
Cheers,
JFC
|
|
|
|
|
I don't know the value of connect timeout ? It's too Long.
Do you how to change this value?
Thanks
|
|
|
|
|
Try using setsockopt API.
|
|
|
|
|