How to set mfc resource DLL's associated code behind project - dll

Never have known if this is even possible - and if so - how?!!
But I have our MFC applications separated out into the exe project, and a set of associated resource-only .dll projects, one per translation.
We only need to maintain English, and then parse the resources using a 3rd party translation suite to extract translatable strings, get them translated, and then constitute a translated resource .dll project for shipping.
It's a neat coherent system but for the fact that I cannot use MSVC's built-in MFC editors to connect up visual interfaces back to the correct code in the .exe project files.
If I try to use the resource editor to - e.g. generate an MFC Dialog subclass as the code-behind for a given Dialog resource - then the MSVC environment tries to create such files in the resource .dll project - which is wrong and unhelpful.
Does anyone know of a technique to get a given resource project to say "Hey - all of my code-behind should be in this other project over there?

Related

VB.NET how to prevent embedded images in the executable

I'm working in a VB.NET application using Visual Studio 2017.
I'm using a lot of images in my project and if I follow the instructions that I've found in the Internet (add images to a resource file) the executable ends up weighting more than 300MB. This is a huge problem because when I want to send updates to the users they have to download every time 300MB instead of just a few KB, and perhaps some additional images.
I would prefer the images to be stored separately from the executable, in the same folder, but this does not seem to be possible because using the resource file and building a release version they all get eaten inside the executable.
(Note that I need the images to show while working on the designer module, so it is not an option to load them all through code using image.fromfile, which would do exactly what I want)
Can someone point me in the right direction? Thanks a lot in advance.
You can create a separate class library project in the same solution. A class library project is compiled to a DLL. Include the image resources in this library project and add it as project reference to the main project.
If the image resources don't change, you don't need to re-distribute this DLL.
A trick that could enable you to use these resources at design time could be to use satellite assemblies for culture specific resources (I never tried it so). In your case you would have only on single culture.
See:
Locating and Using Resources for a Specific Culture (MSDN)
Localizing a Windows Application with Satellite Assemblies (article uses C# but should be the same procedure for VB).
How to Localize Windows Forms and Change the Language at Runtime

Game Engine as EXE and Game as DLL?

Hi guys I'm starting the design of a new little game engine and I was assuming the game engine as a DLL and then build a project for the game that would use this DLL and output an EXE file.
But then I read about the latest ID Tech Game Engines and how they do it the other way around. (http://fabiensanglard.net/doom3/index.php)
It's not really explained why though. I have the feeling it has something to do with modding as only the Game (DLL in this case) was open to the public for quite some time while the Engine (EXE) was closed source.
But I would like to know if there are other reasons for this.
As fas as I know the DLL project should have all the reusable code. The normal project should be the application, which would reference the reusable DLL. This way you can build a framework in the DLL project that can be used for any of other future projects.
The other only reason I can think of is that AFAIK only the name of the DLL is recorded in the program file, no text or data so if the Game is potentially bigger than the Engine, it could make the executable size smaller.
[EDIT]
I have thought of another reason to have it this way: The Engine is an EXE so it could be that it could be used without a Game DLL? Like for tools such as CAD or scripting?
If you are using a library in an application e.g. a game, then you have an app with an EXE with zero or more of its own DLLs consuming a library with one or more DLLs.
If you have a generic environment loading elements that customize it's behavior, thus making it a specific game, then you have an environment with an EXE and zero or more DLLs which uses configuration to load various DLLs and configuration files to determine its behaviour.
Either easy, you should probably have more than two assemblies in your application.
E.g. one (the EXE) for loading the main config and modules and connecting them all, one for the main UI, one for the graphics, one for the physics, one for the AI and etc.

VB.NET as a game development tool

I come from a Mac background. I developed games with Xcode and Objective-C frameworks.
Recently I moved to Windows and decided to use VB.NET for a while. It is cool.
Here is my intention:
I want to develop a Windows platform game. The game is rather complex, and I will need some kind of "engine" or "editor" to be able to edit my levels and properties easily. The idea is that I can build most of the game with this editor and then the editor will compile the project files and resources into one .exe file for gaming.
Fortunately, I was able to create my editor with VB.NET. I am able to edit levels and such. However, I am not sure about the "compilation" part to create a .exe file and play the game.
Basically I am at the point of designing the "Compile" button in my editor. But I am clueless. I could not find much documentation regarding this topic.
My editor has all variables and information the game needs to run.
I assume that this .exe file is like another VB.NET project (produced by my editor) that will basically take the data it comes with and "run" the game loop alright.
Any ideas, links, etc? Thanks.
**Note: my game is a 2d game with, probably, a vast amount of sprites and such.
Visual Studio is a fantastic IDE for development of Windows apps. Compiling the project is pretty simple. You just compile and it gives you an exe that's in the .NET Framework. Microsoft also has XNA Game Studio to help with game design if you want to look at gaming frameworks for .NET.
Also, you can take files from your editor if they generate vb.net and use the vbc compiler command to compile them into libraries, executables, whatever you like. The command could be something like this:
vbc /reference:Microsoft.VisualBasic.dll File.vb
Here's a link to the .NET command line compiler for VB.NET.
I'm not entirely sure what you mean here. Are you saying that you have an editor (something like a level or map editor?) for your game, and that you want the output of this editor to be embedded into the exe for your actual game application when it compiles?
If that's the case (or something similar to it) then you'll first want to consider how to persist your data to file. Then you could manually add files you've created as embedded resources. Or better yet, create a file type that holds as many 'levels' or 'maps' as you need and embed that. This way as you create more they will just get added to that file and you won't have to keep adding more embedded resources.

Silverlight - Useful extension methods in system.data.* namespace

I have a number of very useful extension methods that I'd like to use in my Silverlight project.
I've pasted the Module here http://pastebin.com/TfBpNDWr
The problem I'm having is that visual studio complains that the dlls my module have been written against have not been built against the Silverlight runtime.
Is there an easy way to get these extension methods working in Silverlight?
I'm thinking my main hurdle is getting IObjectSet and ObjectContext to run against the Silverlight run-time - perhaps there's another way to expose these methods that I'm not aware of.
When you want to reuse code in such way, there are these three options I'm aware of:
Generally create all your basic class libraries as a Silverlight class library project, or, more officially, as a Portable Class Library. Throw all references out except for mscorlib.dll, System.dll and System.Core.dll. You can then link such kind of library in any full .NET project.
You can link individual code files from another project with the "Add as link" feature (Right click project -> Add Existing Item -> Change "Add" Button to "Add as link"). That way you can create a Silverlight project and link individual files from your full .NET project. However that can get tedious if you have a lot of files and you often add/remove files and folders in your source project.
To cure this problem, you may check out the Project Linker at http://msdn.microsoft.com/en-us/library/dd458870.aspx ... but I haven't tried it myself yet.

how can I create DLL without having class

can anyone give me some steps to create DLL without using class which means it will just have methods in the header file and source file would be only DLLmain() plus other methods. I'm using Visual Studio 2005 to create MFC DLL, but it always generates class. I never create DLL before but I was told that I can create DLL without class/object oriented concepts, just plain functions.
thanks.
For a regular Win32 DLL:
In the New Project wizard, under Visual C++ / Win32, choose Win32 Project.
Then in the next page, choose DLL as application type.
You may want to select Export functions as well to get sample code of exported variables, functions and classes.
From there on, simply delete what you dont need (such as classes).
I no longer have the Windows Mobile SDK installed, but I'm pretty sure you'll find the same kind of wizard to create a Windows Mobile DLL project.
Of course, if you don't want C++ classes, forget about MFC!