|
Hmmmmm!
Do you really know about the licensing issue involved in using GIF in an application?
Please forget this and try animated icons, or take control and do a complete bitmap selection/rotation yourself, see MS debugger sample DEB for illustration.
Regards,
Paul.
|
|
|
|
|
Hi Forum,
I would like to set a bitmap (sign of firm) in the frame of the mainframe of a mdi-document! normaly its windows-default gray.
Have somebody a solution?
Thanks!
|
|
|
|
|
Here's the solution from The MFC Answer Book by Eugène Kain:
- Create a new CWnd-derived class (we'll call it CMdiBackground). This will be used to subclass the MDI client window.
- Add handlers to this class for WM_ERASEBKGND and WM_SIZE.
- In OnEraseBkgnd, call CWnd::OnEraseBkgnd() and then do whatever custom painting you want.
- Your OnSize() handler should call CWnd::OnSize(), followed by Invalidate(TRUE).
- Add a CMdiBackground member variable (call it m_wndMdiBackground) to your CMainFrame class.
- Add this code to the end of CMainFrame::OnCreate()
if ( !m_wndMdiBackground.SubclassWindow(m_hWndMDIClient))
{
return -1;
}
--Mike--
==================
The original message was:
Hi Forum,
I would like to set a bitmap (sign of firm) in the frame of the mainframe of a mdi-document! normaly its windows-default gray. Have somebody a solution?
Thanks!
|
|
|
|
|
Hello,
My codes at the following does this and more!!!
http://www.codeproject.com/docview/mditab.asp
Regards,
Paul.
|
|
|
|
|
I have created a custom control in a DLL and it works perfectly when used in a
dialog box or property page.
However, if I try to use the control in a view window, I get infinite recursion.
The following window procedure is straight out of David Kruglinksi:
LRESULT CALLBACK AFX_EXPORT
OCTimeslotCtrlWndProc(HWND h_wnd,UINT message,WPARAM w_param,LPARAM l_param)
{
CWnd* p_wnd;
p_wnd = CWnd::FromHandlePermanent(h_wnd);
if (p_wnd == NULL)
{
//
// first-time; a new window has been created
//
p_wnd = new OCTimeslotCtrl;
p_wnd->Attach(h_wnd);
ASSERT(p_wnd == CWnd::FromHandlePermanent(h_wnd));
}
ASSERT(p_wnd->m_hWnd == h_wnd);
LRESULT l_res = AfxCallWndProc(p_wnd,h_wnd,message,w_param,l_param);
return (l_res);
}
As I said, this works fine when the control is used in a dialog box. However, when used
in a view, the call to AfxCallWndProc simply indirectly recurses back to OCTimeslotCtrlWndProc.
A stack overflow immediately occurs.
Does anyone know how to get a custom control in a DLL to work everywhere?
|
|
|
|
|
I want to give people a 30 day working version of software that I write and after which time, if they haven't entered the correct password then the program fails to execute.
If I just hardcode some password like 'duckpond', then what stops an individual from giving that password to
someone else? Nothing.
I am confused and frustrated. Please, any response you can give me will be greatly appreciated. Details and a sample project would be cherished.
Sincerely,
Erich J. Ruth (an overworked graduate student)
|
|
|
|
|
Hi!
When the program starts for the first time you can add the item in the registry with the date of the first use and check it all the time the program starts.
Concerning the password you can use different techniques... For example, at the first run you can generate a unique serial number for the program and save it in the registry (it can be a GUID). Later when the version expires the user will have to send (tell) you the serial number and you will give him the password which will work only with this serial number. You can easily make a password out of the serial number.
In this case if the user will run this program on the different computer he will need a different password.
It's just an idea, but it can help you ...
Regards,
Alex Gorev,
Dundas Software.
==================
The original message was:
I want to give people a 30 day working version of software that I write and after which time, if they haven't entered the correct password then the program fails to execute.
If I just hardcode some password like 'duckpond', then what stops an individual from giving that password to someone else? Nothing.
I am confused and frustrated. Please, any response you can give me will be greatly appreciated. Details and a sample project would be cherished.
Sincerely, Erich J. Ruth (an overworked graduate student)
|
|
|
|
|
Don't do this with a hardcoded password. Use the registry, and an install program.
First step. When you install the software with the install program, and you setup all your default registry settings, add a new registry item (call it something inconspicuous).
Second Step. Get a GUID number and the date you are doing the installation. Using a (secret) calculation, merge these two numbers together, and store them both in the registry.
Now when you start your program, get the current date. Calculate the install date from the registry data, and work out how many days are left for the user to use your software.
Of course there are many other possible methods. This is just one way, there may be a way which suits you better. Of course you could always just store the install date in the registry, but there is nothing to stop someone changing it. For that matter theres nothing stopping someone really determined from cracking the method I just described.
Good Luck.
|
|
|
|
|
As you say, "there's nothing stopping someone really determined...."
I experimented with a similar method a while ago. I generated a GUID and stored the install date in a binary form under the GUID in HKEY_CLASSES_ROOT (where I thought it would be inconspicuous).
It all worked well until I ran a registry cleaning program which spotted the entry as "orphaned" and offered to remove it.
The moral being of course, try to crack it when you've written it, and if your succeed, try something else.
Even better, try a combination of approaches - writing an encrypted file to Windows\System32 may be a good idea as well.
|
|
|
|
|
Hi,
I have do a console program with Visual C++ 5.0.
When I run this program from the Visual IDE, the console program run in a DOS window.
When the program is terminated , the DOS window keeps open.
When I run the same console program from the Explorer or from the desktop, the DOS window
automatically close when the program is finish.
How can I get the DOS window still opened when my console program ends?
(I can do this with a batch file, but I want to know if it is possible without a batch file)
I have check the properties and I get only one or two tabs. I can't control the screen.
Thanks,
Claude
|
|
|
|
|
Hello,
This is the trick. VC++ does not directly run your application. Instead it hands it over to another console application vcspawn.exe in the VC++ bin directory. This executes your program as a process and wait till it completes and then prints
"Press any key to continue".
It then immediately sets itself to receive an input from the user and any key pressed is enough to get it to the end of its main().
To simply emulate this, at the end of your main(), do something similar to
int main()
{
.....// your main code ends here
// End of main processing
cout<<"Press any key to continue..."<
|
|
|
|
|
Can anyone provide some information for me on how to get an NTP timestamp. Preferably id like an API rather than having to implement the protocol myself or include someone elses code in my project.
|
|
|
|
|
I am having trouble getting bendy text to print.
I have been using the code from the sample project TEXTFX which comes with MSVC to create text that is bent around curves and such. All goes well when I am using the screen DC, but when I use the printer DC, the bent text does not print properly. What it appears that I am getting is the text flattend to a line of my curve i.e. no height on the text. The text is in the proper place on the page.
further information on this can be found in MSDN article Q128091 HOWTO: How to use paths to create text effects.
any suggestions?
|
|
|
|
|
Hi, I have a program that is currently running on Window 95 and I use the _inp function
to write to a register on a legacy ISA board. I want to run the program on Windows NT
but NT will not support the inp() function. Is there another way I can write to a port that
NT will support?
|
|
|
|
|
OS : Windows 95/98/NT. sp 5
Tool : VC++ 6.0
Hi there every one,
I'm working on returning multi-dimensional result sets using MDX and ADOMD. I have openned up the CellSet with the snipet below:
ICellsetPtr m_CellSet("ADOMD.Cellset");
m_CellSet->PutSource(pvSource); //pvSource MDX sql statement
m_CellSet->ActiveConnection = m_connection;
m_CellSet->Open();
The next thing is to get access to the data in individual Cells with:
m_CellSet->GetItem(SAFEARRAY** idx); //prototype for method
//I do;
SAFEARRAY * CellArray;
SAFEARRAYBOUND CellArrayBound;
CellArrayBound.cElements = 1;
CellArrayBound.lLbound = 0;
CellArray = SafeArrayCreate(VT_I4, 1,CellArrayBound);
m_Cell = m_CellSet->GetItem(&CellArray);
I've tried various ways but I keep getting "incorrect parameters"
There does not seem to be any example in VC++ on ADOMD.
Has anybody out there done any ADOMD in VC++? I need help especially where Cells items are created
Thanks]
Michael
|
|
|
|
|
OS : Windows 95/98/NT. sp 5
Tool : VC++ 6.0
Hi there every one,
I'm working on returning multi-dimensional result sets using MDX and ADOMD. I have openned up the CellSet with the snipet below:
ICellsetPtr m_CellSet("ADOMD.Cellset");
m_CellSet->PutSource(pvSource); //pvSource MDX sql statement
m_CellSet->ActiveConnection = m_connection;
m_CellSet->Open();
The next thing is to get access to the data in individual Cells with:
m_CellSet->GetItem(SAFEARRAY** idx); //prototype for method
//I do;
SAFEARRAY * CellArray;
SAFEARRAYBOUND CellArrayBound;
CellArrayBound.cElements = 1;
CellArrayBound.lLbound = 0;
CellArray = SafeArrayCreate(VT_I4, 1,CellArrayBound);
m_Cell = m_CellSet->GetItem(&CellArray);
I've tried various ways but I keep getting "incorrect parameters"
There does not seem to be any example in VC++ on ADOMD.
Has anybody out there done any ADOMD in VC++? I need help especially where Cells items are created
Thanks]
Michael
|
|
|
|
|
Hi,
I have to open a document file (word97) in a c++ program.
Where can I find the doc file specifications?
Thanx.
|
|
|
|
|
Go to www.wotsit.org and search for "doc".
==================
The original message was:
Hi, I have to open a document file (word97) in a c++ program. Where can I find the doc file specifications? Thanx.
|
|
|
|
|
hi
how do i set a bitmap button with a PUSH BUTTON style??
the push button style works just with a text button....
(in mfc)
|
|
|
|
|
Hi All
I am trying to show an overly large dialog sheet within a tab control. By overly large, I mean
that the dialog sheet does not fit on the normal sized page in the tab control. I'm thinking
that I will need to somehow put a scroll view inside the tab sheet first, then put my dialog
in the scroll view.
Has anyone done anything like this? Is there an easier way to do this?
|
|
|
|
|
Can anyone tell me how to drag an object from an application to the shell - much like Internet Explorer where you can drag a picture in a HTML page to a folder and having the graphics file created on disk.
I have looked into the documentation, and it seems that tehre are some COM classes for doing it, but I cannot make it work.
Dos anyone know of a sample or article on the subject.
|
|
|
|
|
How can I get the file name of a module having an HWND or ProcessID. I need it in an Win95 application.
I can not use GetWindowsModuleFileName() because is not compatible on Win95.
Please help !
|
|
|
|
|
Here's something that may help:
Use CreateToolhelp32Snapshot to get a (handle) to
a snapshot of the processes etc., then traverse the
processes using Process32First and Process32Next
(using the handle returned by CreateToolhelp32Snapshot
and a PROCESSENTRY32 structure).
The PROCESSENTRY32 structure has a member called:
szExeFile
which will contain the path and filename of the
executable file for the process.
In your case, if you have a ProcessID, you could
compare it to the th32ProcessID member of the
PROCESSENTRY32 structure (or th32ParentProcessID)
to isolate the process you are after, and then use
the szExeFile member.
See 'Tool Help Library' in MSDN library, and go to
Using the Tool Help Functions -->
Taking a Snapshot and Viewing Processes
It appears that THL is Win 95/98/NT/2000 compliant.
Hope that helps.
==================
The original message was:
How can I get the file name of a module having an HWND or ProcessID. I need it in an Win95 application. I can not use GetWindowsModuleFileName() because is not compatible on Win95.
Please help !
|
|
|
|
|
Hi,
I would like to know how to get the device context of a MCI window.
I've already created that window (Hwnd). It is holding the frame of a avi video
in a snapshot. And how to save it as a Cbitmap. Thanks a lot
The code is like :
m_hAVI = MCIWndCreate(m_hDlg,
AfxGetInstanceHandle(),
MCIWNDF_NOPLAYBAR |
MCIWNDF_NOAUTOSIZEWINDOW |
MCIWNDF_NOERRORDLG |
WS_VISIBLE |
WS_CHILD |
WS_BORDER |
WS_DISABLED,
NULL );
MCIWndUseFrames(m_hAVI);
MCIWndOpen(m_hAVI,(LPCSTR)m_efile,0);
MCIWndSeek(m_hAVI, m_estart_frame);
// Show mci windows
::SetWindowPos(m_hAVI, HWND_BOTTOM,
x_mci, y_mci, m_width,
m_height,
SWP_NOACTIVATE);
Best Regards,
Julian
|
|
|
|
|
hi,
i'm looking for a class to make a ftp client and server.If you have a program which does it, it will be welcome to.
thanks.
|
|
|
|