|
I programme using Visual C++ 7 on Windows XP but would like to develop code to run on a minimum of Windows 98. I am confused on what modifications (if any) to make to the stdafx.h file.
Below is the text from the define part of the file.
#ifndef WINVER
#define WINVER 0x0410
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400
#endif
#ifndef _WIN32_WINDOWS
#define _WIN32_WINDOWS 0x0410
#endif
#ifndef _WIN32_IE
#define _WIN32_IE 0x0400
#endif
Thank you
Isaac Inyang
Ansyl Technologies
|
|
|
|
|
I don't know what to tell you about your header file but,
you could actually do that by calling GetVersionEx to find the windows version your program is running on. If it's not the version that you like, then display a message and close the program.
However, my impression is that you want to do this because you want to make sure that a feature is present in the operating system. I read an article once about this and the only suggestions that I remember were to use LoadLibrary and then GetProcAddress to find out if certain functions are present. Also, you can use GetSystemMetrics for other features that you might be interested in. And finally you could use DllGetVersion. I am sure that there are other people that have more to add to this topic.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Thanks a lot.
I just want to ensure that my programme would run successfully in Windows 98, Me, 2000 even though I develop the codes on a Windows XP Machine.
Looking forward to getting a reply from you.
Isaac Inyang
Ansyl Technologies
|
|
|
|
|
I am sorry. I thought you were asking about how to determine if your program is running on the correct windows version.
I really don't have an answer for your question. Usually when I use a function that is kind of new to me, I check the minimum OS requirements for it. Sorry, I can't help you.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
I'm able to shut down, log off or restart windows by using ::ExitWindowEx , but don't know how to implement the "Lock Computer" feature which windows2000 has, any help appreciated.
|
|
|
|
|
::LockWorkStation()
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
First of all, thank you for providing the API name so I have some keyword to type when I start searching...
Second, I guess I need more help my compiler(vc++ 6.0) insists that "LockWorkStation" is an undeclared identity even though I have specifically(unnecessarily) included "<winuser.h>" which according to MSDN should be where "LockWorkStation" was declared, still got "undeclared identity". Maybe I need to install newer plateform sdk or something?
Thanks.
|
|
|
|
|
=[ Abin ]= wrote:
Maybe I need to install newer plateform sdk or something?
That would be a good idea
It is available with the files that come with VC6, but you need to #define _WIN32_WINNT (0x0500) or higher before including winuser.h .
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Operating System: Windows XP Language: VC++ 6.0
Does anyone know of a good method to scroll images into a window (similar to how PowerPoint scrolls slides into view during a PowerPoint presentation). In particular I'm trying to develop an application that:
1. Loads images from disk and stores them in memory.
2. Scrolls a previously loaded image onto a window (bottom to top) at a configurable speed, over the top of any image that is already there.
3. Keeps processor usage to a minimum
I've done some experimenting with GDI+ using Graphics::DrawImage() to redraw the image onto the screen a couple of pixels at a time but it sends the processor usage on my computer up to 100%.
Regards
Martin
|
|
|
|
|
I use GDI+ and use FillRectangle() with a TextureBrush - it's considerably quicker than using DrawImage() . I haven't looked at the processor usage, but I think it would be much less - it doesn't have to scale the image like DrawImage() does (unless you specifically tell it to).
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I might try that myself. Thanks for the tip.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
You're welcome
I can't remember how I found that out. I think I just experimented
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Is there priority when you set Background,
Foreground and Fog color?
I made Background & Fog the same color, but
I can't change the color of object drawn in the 3D space
When I change the color of background, this object color
changes as well. It wasn't problem before I insert this
fog function. Any Idea?
Thanks for help
Shinya
|
|
|
|
|
call glColor[X] before calling the glVertex[X] functions!
Don't try it, just do it!
|
|
|
|
|
Thank you very very much. I've searching for this answer.
It worked this time. But Do you know why?
Regards,
Shinya
|
|
|
|
|
Hi!
I write a image processing algorithm library in c++. Now i try to port it into a com dll server, in that way we can use it outside c/c++ environment. Then i can sell it to the developers of vb or c#.
But there is a problem, how can i protect it. Users of my client's application should not directly use it in their own development.
I read in msdn, and know activex control has a license engine (use lic file?). Is COM dll server the same as activex control (i really puzzled in this)?
Is there some method to protect it besides controlling document of library and some law warning?
Thanks!
|
|
|
|
|
ActiveX controls let you develop controls based on the Common Object Model (COM) that can be installed in dialog boxes or any ActiveX control container application. An ActiveX control is an COM-based object. Therefore the article that you read on the lic file should apply to your com server (is it, MFC ActiveX Controls: Licensing an ActiveX Control?).
In my opinion you could try to protect the dll by distributing one version for the application and another one for the developers.
To protect it you can have the initialize functions such as CoCreateInstance perform a license check before they return anything. The license key can be generated internally by the dll (i.e. have a function that generates a key based on some hardware numbers). You know that is not a topic that can be discussed with just a few sentences. So I will stop here. Check out some packers that can protect your software and that way you won't have to worry about implementation details.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
I've been looking at a mass of spagetti code (which is supposedly an MFC app) from one the other monkeys here which for some reason has a dependency on msvcp60.dll. All our other MFC apps dont have this dependency - they only require mfc42.dll and msvcrt.dll - why this one?
|
|
|
|
|
msvcp60 contains classes such as basic_filebuf, basic_ios, etc. that start with the word basic_ (those are the ones I recognize at least). Those are not the only things in the dll, there are a lot more functions and classes. Try to use dumpbin /exports to see all the functions that are being exported.
I just had another idea. Remove msvcprt.lib (that's the library I believe) from the linker's options and you will get a bunch of errors telling you that you have external dependencies missing. That way you will be able to see what functions in the source code are linked to msvcp60.dll. I hope that makes sense.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Halo,
I still have some problems retrieving the selected data from a list box,
I showed my earlier code which was wrong, and got some ideas from a friend from this site and as suggested by him I used the function LB_GetItemdata.
Here is the code
void Cdlg4Dlg::OnDone()
{
HWND w=GetDlgItem(???? ,IDC_LISTBOX1);
LPARAM j=SendMessage(w,LB_GETITEMDATA,0);
}
so the GetdlgItem returns a handle to the list box, but i dont know what to be put for the first parameter (????).The MSDN site says that it is the handle to the dialog box containing the list box, how do i get it..can i put the id of the dialog box?? )like IDD_DIALOG1..
and another doubt..Will 'j' be the data which is selected in the list box or will that be a differént one..if thats not going to be the data selected , then how can i get the data (a number in my case) selected from list box be stored in a local variable?
some example codes will be helpful..
My question might be too stupid, please excuse since I am beginner..
Thanks,
Deepak Samuel
|
|
|
|
|
Deepak Samuel wrote:
but i dont know what to be put for the first parameter (????).The MSDN site says that it is the handle to the dialog box containing the list box, how do i get it..can i put the id of the dialog box??
No, it is the window handle of the dialog box - m_hWnd
That SendMessage() call will retrieve the application-specific data for the first item in the list box. I would get the selected item like this:
void Cdlg4Dlg::OnDone()
{
CListBox *pList = (CListBox*)GetDlgItem(IDC_LISTBOX1);
int nSel = pList->GetCurSel();
}
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi,
Thanks for the help, but it still doesnt seem to work..
when i print out the value of nSel, regardless of the data i selected, it shows zero
CListBox *pList = (CListBox*)GetDlgItem(IDC_LISTBOX1);
int nSel = pList->GetCurSel();
FILE *fptr;
fptr=fopen("mynewfile.txt","a");
fprintf(fptr,"The value is %d",nSel);
fclose(fptr);
Let me tell you, the way I created my list box :
I clicked insert activex control and clicked
ListBox DTC (That was what I wanted)
In the properites box, listbox style shows "DROPDOWN".
Please help me out,
Thanks.
Deepak Samuel
|
|
|
|
|
Deepak Samuel wrote:
activex
You didn't say it was an ActiveX control. Neither my nor your solution will work for an ActiveX control, only for a standard Windows listbox control. The ActiveX control you're using should have a function for retrieving the current selection, but I don't know what it is - it depends on the control. For something like a list box, I'd recommend you use the standard Windows list box control anyway, unless there is a specific reason why you want to use the ActiveX one.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
How do I load text into a browser control witout using a file(or URL)?
WebBrowser1.Navigate() take either filelocation or URL.
Thanks in advance.
H.
|
|
|
|
|
To use Windows XP-visual styles in my app I should use Manifest file. But it works only if I compile project with VC7. Is it possible to do it with VC6?
|
|
|
|