|
If your stdafx.h files have:
#include "resource.h"
in them then that would cause a recompile of your pre-complied headers, right?
|
|
|
|
|
Hello to all !!!
I'm quite new to DLL and I have a simple (I think) question.
Can I have a Dialog (from resource) in a DLL and have the implementation in the main program (exe) and be able to load and display that dialog from the main exe ??? If so, how can I do it !?!?!? Can someone explain to me how such a thing can be done.
Thanks in advance for any help
Have a nice day !
|
|
|
|
|
Hi :
Its pretty simple.
Insert a new resource to your dll ( Dialog ) and add class to your resource inheriting from CDialog . and in the dllmain just
CMyDialog dlg;
dlg.DoModal() or Create and ShowWindow.
Now from your Exe jusrt call load library and that is it.
|
|
|
|
|
The code :
[
float f = 10.123;
printf("%10.4E\n",f);
]
results (Microsoft Visual C++) :
1.0123E+001
How to print 1.0123E+01 ? (2 digits after E instead of 3)
Best regards,
Peter
|
|
|
|
|
It seems to me that you can't get 2 digits instead of 3.
But you can print to string using sprintf() instead of printf(), find unnecessary '0' character and remove it.
|
|
|
|
|
Hi,
I created a funtion DbgMsg(LPSTR lpszMsg, .............) that will allow me to handle to print debugging strings to the debugger. The problem is
that it will crushed if a null pointer is passed. I would like to check for the number of args passed. Is it possible to do it.
This is how I will call the DbgMsg()
DbgMsg("Testing 123 %d %s", x, szTemp)
DbgMsg(LPSTR lpszMsg, .............)
{
char szTemp[256];
va_start(args, szString);
wvsprintf(szTemp, szString, args);
OutputDebugString(szTemp);
va_end(args);
}
|
|
|
|
|
Hi,
Can I include a gif file in the resource file. If yes, how can I load it, loadbitmap(...)??? Also, how to retreive the palette used in order to support 256 colors.
Thanks
|
|
|
|
|
yes. but don't.
neither MFC nor Win32 supports GIF directly.
even worse, if you want to use GIF code in your app (reading OR writing) you have to obtain a license from Unisys. many thousands of dollars...
a better alternative is PNG - better compression, more flexible, free, well supported.
here's a plug for my stuff, but there are plenty of places to find this kind of thing:
http://www.smalleranimals.com/isource.htm
-c
|
|
|
|
|
Hi,
Surely you can include one of GIF format..
If you need draw it or .jpg file format,
use OleLoadPicture()..
You know IE can draw many image formats..
As you can see on this site...
Deep inside, this API use IPicture interface...
Anyway...If you need some sample, thead to this thead..
With best wishes,
-Ryan
|
|
|
|
|
:: You know IE can draw many image formats.
but, without a Unisys license, using it to draw GIF is illegal. if you like, i can find the MS page where they state this.
-c
|
|
|
|
|
does anybody know of a good
dice.ocx for a board game?
please!!!
|
|
|
|
|
I've tried to generate a non(!)resizeable formview and I checked several ideas but without success!
Perhaps someone has a good idea or solved this problem already in the past!
I would be glad to receive some suggestions!
Thanks a lot!
ralph
|
|
|
|
|
You must set the Window-features of the Frame, when
the frame is creting.
try function
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
cs.dwExStyle= 0 ;
cs.x=0;
cs.y=0;
cs.cx=GetSystemMetrics(SM_CXSCREEN)+1;
cs.cy=GetSystemMetrics(SM_CYSCREEN)+1;
cs.style =0; // WS_MAXIMIZE;
to manipulate some settings in the CREATESTRUCT.
Show in your MFC-Help for the discription.
|
|
|
|
|
1. if I used the SHGetFileInfo() I got folder one icon for folders and drives (only one type) and I got something document-type icon for others. (for all extensions: .gif, .htm*, .etc. got the same icon)
Or did I make a mistake?
2. if I used the IExtractIcon interface of IShellFolder I got good icons (eg. different for drives, even different if a drive is shared) but I'm using an Icon-Changer application which changed these icons more beautiful than they were.
I did dig in MSDN, overviewed many web pages, but I was not able to find a simple function which can give me the same icons what Explorer shows me in left pane as treeview.
I use the (absolute) LPITEMIDLIST argument as input in my function. I don't use MFC.
How can I get these icons correctly?
(or is it simplier to put the Explorer's left tree pane into my treeview control? if yes, how can I do this?)
Thanks in advance for those who can give me some information.
---
AkelA
|
|
|
|
|
I'm writing a program which can load some HTML pages from an external source. That is a IE application with a server of his own. Until recently everything worked fine: my program builds an url and uses CHtmlView::Navigate2() to display the HTML page.
But now I'm getting the error above. I don't have the faintest idea where this comes from and whether it's my app or the other app that causes the error. The other app still works fine.
I know it's quite vague all, but can anyone give my some clues where to look?
Thanks.
|
|
|
|
|
I need to detect the installation of Windows Media Player 6.4 or greater.
Surprisingly, I have not been able to find information on this topic. Does
anyone know how to detect the presence of this player? Registry? *ocx? I am
up against a deadline and need HELP!!!!
|
|
|
|
|
You've got the right idea. I had to do the same recently with IE ( need 4 or greater ), and DirectX ( need 5+ ). I found the answer was to poke in the registry, best place is HKEY_CURRENT_USER\Software\Microsoft. Get onto some machines with earlier versions and make sure you've found a key that persists across versions & gives you the info you need, and you're away.
|
|
|
|
|
When you move your mouse over a menu item, the Status bar is updated with some text describing that emnu item. From what I can tell it comes from a string table. I either need to 1) modify the string table at run time (is that safe??) or 2) assign it to an in-memory string. Unfortuteately, I have not been able to find anything on the interaction between the two classes. Does anyone know how I can override this behavior?
Thanks.
|
|
|
|
|
Override CFrameWnd::GetMessageString() . You receive the menu item ID, and if you want to change the status bar string, just return the string to be displayed. Otherwise, call the base class version which will load the text from the string table.
|
|
|
|
|
Im New to Visual C++ but I am quite familiar with the outportb(){DOS} command etc.
Can anyone help me to interface the ports using MFC - Is it possible ? - I am trying to interface to a Micro-Controller
Any Samples would be grateful.
|
|
|
|
|
The Win32 API calls
CreateFile(...)
ReadFile(...)
WriteFile(...)
CloseHandle(...)
will get you much of what you are looking for. There is an MSDN sample called TTY which shows all of the serial port setup stuff.
I believe these commands work for parallel ports too, but I've never tried. The commands are not as low level as outportb() but they may do what you are looking for.
You may run into a problem with the LPT port as it may be expecting certain pins to be set high (as it expects a printer to be there). You will likely only have access to 8 pins on the port (2 through 9) as Windows probably won't give you access to the other 2 registers.
If you are using Windows 95 exclusively, you can use outportb() if you write a DLL.
E-mail me if you have any questions
|
|
|
|
|
If you use Win9x you can use outp() and inp() with <conio.h>.
For NT you need a Kernel-driver.
Check URL http://www.sybera.de/english/e_frame.htm
for a good free driver ->SHA basic pack.
|
|
|
|
|
Well I wanted to send 2 pictures, but I don't know how can I attach them. It won't be so easy to describe myself, but I'll try...
I implemented a NameSpace handling code in VC++6.0, without MFC. It works, but it has some problems.
1. I can show the folder's icons. These are OK, and looks like as "original" windows icons. But I use an ExtractIcon application. This app. changes many of system icons. (desktop,my computer, normal directories, shared directories, etc.) How can I ask/get/handle these icons (too)?
2. I can enumerate subfolders. But when I show them the order of subfolders are not the same as in Explorer. How can I sort them?
3. usually I got back no icons. Why? (this func. can not extract all kind of pidl-s?)
4. here's a part of my code: (instead of two pics)
How can I solve the #1, #2 and #3 questions?
// lpsf: interface pointer
// lpi: absolute pid (merged myself)
// hIconSmall: the icon what I want to get
bool ANameSpace::GetDisplayIconOf(IShellFolder *lpsf, LPITEMIDLIST lpi, HICON* hIconSmall)
{
bool _back = true;
HRESULT hres;
IExtractIcon *pxi;
// get IID_IExtractIcon interface
hres = lpsf->GetUIObjectOf(NULL, 1, (LPCITEMIDLIST*)&lpi, IID_IExtractIcon, NULL, (LPVOID *)&pxi);
if (SUCCEEDED(hres))
{
char szIconFile[MAX_PATH];
int iIndex;
UINT wFlags = 0;
hres = pxi->GetIconLocation(GIL_FORSHELL, szIconFile, sizeof(szIconFile), &iIndex, &wFlags);
if (SUCCEEDED(hres))
{
// I need only the small icon
HICON hiconLarge = NULL;
int cxIcon = GetSystemMetrics(SM_CXICON);
int cxSmIcon = GetSystemMetrics(SM_CXSMICON);
// try getting it from the Extract member fuction
hres = pxi->Extract(szIconFile, iIndex, &hiconLarge, hIconSmall,
MAKELONG(cxIcon, cxSmIcon));
}else
_back = false;
pxi->Release();
pMalloc->Free(pxi);
} else
_back = false;
return _back;
}
Thanks in advance,
---
AkelA
|
|
|
|
|
I can read all records in an EXCEL-file, but i can't EDIT / DELETE stored records.
I use CRecordset and CDatabase.
I can add records to the EXCEL-DB with
...
p_CRecSet->AddNew();
..fill datas
p_CRecSet->Update(); .
If I call
p_CRecSet->Open();
....
p_CRecSet->MoveLast(); //DB is'nt empty
p_CRecSet->Delete(); //exception
p_CRecSet->Update();
the Delete-command return an Exception (access-error).
Is this a problem of the ODBC (Jet/ISAM)-driver (support no EDIT / DELETE / SQL -> CLEAR TABLE),
or is there a wrong function-calling ?
SFR
|
|
|
|
|
I think the call to Open is accepting the default open type of CRecordset::snapshot - that would prevent deletions.
Oddly though, I think it wouldn't allow additions either - hmmm...
Try modifying the Open command to take an open type of CRecordset::dynaset... (?)
|
|
|
|