|
Hey Ty,
That's excellent. A big THANKS! Really, more explanation is better than less, for me anyway. I got really fed up late last night wondering I kept getting the error message and not being able to figure it out. It's just that the explanation of the error does not give any indication that the function would have to be declared static. Hence my frustration!
Thanks once again! Totally appreciated.
Adam.
www.beachwizard.com/travelogue[^]
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
Okay, now you have managed level 1, let's go up to level 2
Using only static member functions (also called class functions) or ordinary C functions as callbacks is boring and odd. But you can use adapters to "translate" a call to a static function seamless into a call to a real member function.
If you are interested in more technical details about the "callback has to be static" issue and a complete solution for it you may want to check out my article Use member functions for C-style callbacks and threads - a general solution.
However, you don't have to read the whole article, you could also just use the provided adapters. It allows you to write code as simple as the following:
#include "stdafx.h"
#include "win_adapter.h"
struct DATA { int foo; double bar; };
class Test
{
public:
virtual BOOL WindowLister( HWND hWnd, const DATA& data )
{
printf(" Window: %p\n", hWnd );
return true;
}
void DoStuff()
{
DATA someData;
win::EnumWindows( this, &Test::WindowLister, someData );
}
};
Programming is fun!
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
What is the best way to smooth window movement on static controls such as picture controls in msvc++ and mfc.
i currently use,
hStruct.HSliderCover = iLoadBitmapFromFile( "graphics/slider_cover.bmp", 0 );
m_picSliderCover.SetBitmap( hStruct.HSliderCover );
m_picSliderCover.SetWindowPos( &wndBottom, 0, 0, 553, 62, SWP_NOMOVE );
CRect rect;
m_picSliderCover.GetWindowRect(rect);
SetTimer( SliderTimer, 1, NULL );
//slider timer
if( nIDEvent == SliderTimer )
{
rect.left++;
m_picSliderCover.SetWindowPos( &wndBottom, rect.left, 420, 0, 0, SWP_NOSIZE );
}
any help would be great.
|
|
|
|
|
There are most likely lots of ways to do this, including the one you're using. My two suggestions are:
- Use a borderless popup window displaying the bitmap, move it - should be accelerated on any not-completely-worthless OS+video card. Or,
- Save an image of the portions you are covering to memory, and then use a separate in-memory bitmap to draw part of it covered by your slider each timer interval; then draw the complete image to the screen in one go.
Shog9
------
If you really what to get shitfacde tell a crowded bar that is is yourt borthday and hife your wallet. you ka will many more friends.
- David Wulff, Brithday selebrations, 9/19/02
|
|
|
|
|
On the users machine, my install program will register the VB com dll automatically. Question is where should I put my VB Com dll? Does it matter? Or will the app go to the registry and locate it itself? The method I'm using to hook the dll has code like :
_ClRemoteCall p;
p.CreateDispatch("DllwithForm.Class1");
and I go through the class wizard .
Thanks,
ns
|
|
|
|
|
If the DLL is specific to your progam (as I guess it is), then it is best to copy it to the target directory where all other stuff belonging to the app inhabits. The registration process takes note of the path where the DLL is, so you have complete freedom to choose its location.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Good to know for sure
Thanks,
ns
|
|
|
|
|
Hi
I'm trying to paste bitmap from program resources into a clipboard:
#ifdef UNIETSIOFFICE_EXPORTS
#define UNIETSI_API __declspec(dllexport)
#else
#define UNIETSI_API __declspec(dllimport)
#endif
int UNIETSI_API WINAPI uniETSIOfficePasteIcon(int nIconId)
{
CBitmap Bitmap;
Bitmap.LoadBitmap( nIconId );
OpenClipboard( 0 );
SetClipboardData( CF_BITMAP, Bitmap );
CloseClipboard();
}
This function is in mfcdll(mfc is linked statically) and everything works perfect in Win2000 (in which I have made my dll) but when I have tried this in Win98 nothing appears in clipboard(dll works, my function executes, all functions used in this code seems to work - return code !=0 - but nothing appears in clipboard). I don't know what is wrong.
Greetings
Mariusz Popiolek
|
|
|
|
|
Is it an icon that you're trying to load? If so, try loading a bitmap instead and see what happens. If is the icon bit that is failing, you might want to use LoadImage instead.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I'm trying to paste bitmap, but I will try to use LoadImage, maybe it will solve the problem (I hope).
Greetings
|
|
|
|
|
Try adding EmptyClipboard() call after OpenClipboard.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
I have an app that has uses the Webbrowser ActiveX object. My problem is that the web site that the Web Browser should show needs to be current and not taken from the history, temp file, or cashe. What I want to know is how to delete or prevent the history, temp internet files, and or cashe from displaying old material, instead it should get the data from the Web Server everytime(Plus be able to detect if it is offline or not).
If anyone can put point me to the river which contains this information, or show me how it is done, I shall be very gratefull. Thanks in advance Shell Gurus and Friends for your advice and guidance!
|
|
|
|
|
First of all, a way to make sure the web page is always up-to-date, is to use the expires meta-tag with 0 as value :
<META HTTP-EQUIV="expires" CONTENT="0">
Now it's easy if you generate yourself the served web pages.
If you don't, you'll need to use the web browser control API IHTMLMetaElement to update the current web page.
More info on syntax here[^].
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
I have a better answer for you. Hope you like it.
See here[^].
Yes, to do what you need you just need to set the IE settings.
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
Hi everyone,
I was searching the net for some programming resources and I stumbled upon this site. I'm looking to eventually get a posistion in the game developing business, but firstly I need to gain experience in programming. I'm 19, and going to college next fall, and I was wondering if maybe you guys could help me out. What is the ideal degree to have for a job in the programming field? I'm very computer literate, but have no knowledge of programming. The most well known language to me, or atleast most heard of, is C++. Would it be wise to perhaps buy Visual C++ and start working with it on my own? It would seem advantageous to me, if I know a bit of computer programming even before I went to college for my degree. Lastly, are there different programs to write C++? Or is it just Microsoft that makes the product?
Thanks,
Brandon
|
|
|
|
|
What is the ideal degree to have for a job in the programming field?
Computer Science, I guess. At least in my country, electrical engineers do quite a bit of programming work, too. If you're good at programming, I don't think the degree you take will make any significative difference when it comes to finding a job in the game industry (but definitely having a degree is better than not having it).
Would it be wise to perhaps buy Visual C++ and start working with it on my own?
Very wise.
Lastly, are there different programs to write C++?
Well, for Windows platform, VC++ is almost the only actual choice. There are other products, but they don't receive as much attention as VC++ does, by far.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
The standard in the gaming industry is still C++ at this point. There are several options to programming out there as far as languages and I have heard of some games programming done in every language that exists. I would recommend Computer Science, although Electrical Engineers are good as well. However I think in Electrical Engineering you may learn more fun stuff (I am an electrical Engineer) you lose some of the theory of programming that may give you an edge over other candiates if all you want to do is software. However you may want to look at a software engineer program if one is available as that would merge more of the two disciplines.
In my honest opinion for what you hope to accomplish studying C++ would be your best choice. Getting used to the Microsoft Visual C++ will get you closet to most gaming environments that are out there, but once again it is not the only flavor of c++ on the market. Linux has gcc. There is borland c++. Each of these will allow you to learn the language and get you in to programming and give you experience.
Another approach for entering the gaming industry and one that I have been exploring is to download the tools for modifying a current game. These modifications often have a script language which is very similiar to C/C++. These are good tools to let you see what is ahead of you, however they may be a little confusing to start with. Don't worry too much about that, but they are good demos.
Lastly, coding or programming to me is a skill that translate well accross boundaries more readily than most. I have worked in Visual C++ for many years now, but after I was laid off and started my new job, I was forced to support Visual Basic code for a while. The reason I say this is that even studying visual basic will help you learn to code and understand object oriented programming. The syntax however will be different, but if you learn to understand outside the syntax and understand the concepts, any language will work for you.
Brian
If you start a fire for a man, he will be warm for a day. If you start that same man on fire, he will be warm for the rest of his life.
|
|
|
|
|
SanShou wrote:
However I think in Electrical Engineering you may learn more fun stuff (I am an electrical Engineer)
You're saying that doing all those circuits analyses and Fourier transforms are fun! It's *because* of all my analog circuits that I'm in software development! bleh. That was some evil stuff.
(end rant)
|
|
|
|
|
Since you're interested in game development, search the microsoft website for directX. Get the sdk and documentation. The programming language would be C/C++, but that's not very important. It's something you learn as you experiment with the technology you're interested in, in this case gaming. I hope you're a dedicated geek , computer science is not for career minded people. You have to love it to succeed in it. Most aspects of it can be very fustrating, only a passion can get you to where you want to be. Especially something like game programming.
|
|
|
|
|
What? Computer Science Degrees aren't for the career-minded? And what inspires that comment?
James A Beggs
Microsoft MSN Mobile Component Test Team
|
|
|
|
|
What i meant was, that computer science is not for people whose main motive is a high paying job. It is usually more difficult than such people anticipate.
|
|
|
|
|
Ah!
Thats cool. I loved CS and programming myself. Can be technical, creative, really use your brain, and still make a decent living.
Well, except in the current market. With all the dot.com collapses that Washington had in the last two years, the IT market really suffered. I haven't worked anything but short term contracts averaging 3 months each in the last two years because of it. And that with an average of a month or so between each contract. Ugh.
James A Beggs
Microsoft MSN Mobile Component Test Team
|
|
|
|
|
Start making mods for games. A lot of mod developers get jobs because of their work.
There are lots of C++ "compilers". A lot of games run on Macs, consoles, etc. and use compilers other than Microsoft. CodeWarrior and gcc are two examples.
Computer Science or an Engineering degree are good for programming. If your highly self motivated you might find CS a bit slow or uninteresting. If that's the case then look into something Engineering related where you can get a good math backgroud. There are also some schools now that offer game development degrees such as DigiPen.
Also have a look at
http://www.flipcode.com[^]
http://www.gamedev.net[^]
http://www.gamasutra.com[^]
Todd Smith
|
|
|
|
|
Hi,
I've heard a lot of those features in Windows XP called side-by-side execution of 'assemblies' and thought it was only available for .NET programs.
But then I consider a description on MSDN showing that even unmanaged DLL's (normal libs and COM libs) could be reside version independent on Windows XP using a XML manifest description.
Now I'm looking for deeper instructions how to use that functionality, but I couldn't find any samples or tutorials on MSDN (only the Platform SDK docs).
Hope anyone can help me by stating a good book, link to a tutorial or even some sample code.
Best regards
Andi
|
|
|
|
|
Search .config in MSDN. Any app can be associated to a .config file with versioned assemblies.
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|