|
Hail all!
How windows know where to search dll's? I don't want to store my debug dlls in system32 but in someone else. Or may be there another solution to run debug projects what uses dll?
|
|
|
|
|
What debug DLLs? Yours? Microsoft?
You aren't allow to distribute Microsoft debug DLLs.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
See MSDN's documentation for LoadLibrary[^].
Generally you should place your own DLLs in your application's directory, unless you're going to ship DLLs shared between many applications, in which case they should go in the Program Files\Common Files directory. Use your installer tool's method for finding this folder (the name is localised and the user may have moved it) or call SHGetFolderPath passing CSIDL_PROGRAM_FILES_COMMON as the nFolder parameter.
|
|
|
|
|
You can also store your DLL with the same directory level with your application or call #import ... in codes to specify where to get your DLLs.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Very puzzling:
I am trying to debug this (its tricky to get the mouse right over the editbox ). It doesnt go into the mouseMove. But if I position the cursor over the part of the parent dilaog which is uncovered by controls, it goes into mouseMove but then of course I'm not in the rect. It looks like the richEdit is obscuring the mouseMove somehow....
void CImageDisplay::OnMouseMove(UINT nFlags, CPoint point)
{
CRect rect;
m_richEdit.GetWindowRect(rect);
ScreenToClient(rect);
if (rect.PtInRect(point))
{
CString str;
m_richEdit.GetWindowText(str);
m_titleTip.Show(rect, str, 0, -1);
}
CDialog::OnMouseMove(nFlags, point);
}
Many thanks,ns
|
|
|
|
|
Ummm... I'd say you've got to subclass the RichEdit control and add the OnMouseMove there.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
That worked great! I read the MAunder subclass article.
Did get puzzled about one thing though............the richeditctrl had no ownerdraw property to check. ALso I didnt use SubclassDlgItem or subClassWindow() at all......just changed CRichEDitCtrl to myCRichEditCTrl in the h file. I cant see when one would ever need to use SubClassWindow() etc ...? Its the subclassdemo.asp in /miscctrl.
Thanks,
ns
ALso --- to subclass the e ditctrl portion of the combobox, how would we get the nID? The entire combobox has an id, but what about just the editctrl part...
Thanks for all the help!
|
|
|
|
|
Well, the appwizard is doing the subclassing for you. You'd need to it by hand if, for instance, the control you're subclassing is not known to the wizard, or if you don't add a member variable attached to the control.
As for your other question, seems (after googling around), that you can get hold of the edit control handle by calling GetWindow(hWndCombo, GW_CHILD) , hWndCombo being the handle of the entire combobox (didn't try it myself.) After getting the handle, you can proceed with manual subcassing. Good luck.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
Does anybody know how to debug a console application that needs a filename as an argument e.g.
program.exe filename
I would like to set breakpoints in the code and then run it. I don't know how I can pass the filename as an argument to the program when I start running the program for debugging.
Anybody with ideas?
I am the handsome one in the crowd.
|
|
|
|
|
If you're using VC++ 6, you can go in the Project Settings, on the debug tab. Look for "Command Line Argument" and your in business!!!
Jean Bédard
Optifor Inc.
Québec,Canada
|
|
|
|
|
I am new to activex.
We have activex dialog box with gridcontrol on top of it.
there is no function to access this grid control in interface.
I need to refresh this grid everytime open up this dialog.
I noticed there is a function called findwindow(specified
title name) and get the handle to the window. Now I get the
handle to dialog. can i access this grid control from here?
Thanks,
Shin
|
|
|
|
|
why am i getting this error eventhough i did the following steps to use the mydll
1) go to project->setting->link->typed myDll.lib in the lib/mod
2) copy myDll.lib, myDll.dll, and myDllClassName.h and paste them into the myTesting program dir
3) include "myDllClassName.h"
4) myDllClassName myDllCN;
CString oldstr = "oldstr";
CString newStr;
myDllCN.Function1(oldstr,newStr); //replace original string with the old str and get the new str back
[code]
ERRORSSSSS
Linking...
LINK : warning LNK4075: ignoring /EDITANDCONTINUE due to /INCREMENTAL:NO specification
myDll.obj : error LNK2001: unresolved external symbol ""public: void __thiscall myDll::Function1(class CString,class CString &)" (?Function1@myDll@@QAEXVCString@@AAV2@@Z)
Debug/FH_Testing.exe : fatal error LNK1120: 1 unresolved externals
[/code]
|
|
|
|
|
|
I wrote the dll using c++.net
To test the myDll I open the new project.
in vc++ 6.0
1) i go to project->setting->linkig->insert myDll.lib into the lib/modules.
2) copy .h, .dll,.lib and paste into mytesting project directory
3) go back to mydll and debug with myTesting.exe
Now I have myTesting project created with vc++ .net
how can i test myDll functions is working or not in .Net
Thank you
|
|
|
|
|
There are two type of dll in general.
Win32 DLL and .NET DLL which AKA assemblies.
To use Win32 DLL which you have I presume.
Go to the URL below. It show how to use C# to do it.
http://207.219.70.31/csharp/interop.asp[^]
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
How can I save a window with graphical paints to a jpeg file????
See the code below:
/////////////////////////////////////////////////////////////////////////////////
//gdiplus
////////////////////////////////////////////////////////////////////////
int GetCodecClsid(const WCHAR* format, CLSID* pClsid){
UINT j,num = 0; // number of image encoders
UINT size = 0; // size of the image encoder array in bytes
ImageCodecInfo * pImageCodecInfo = NULL;
GetImageEncodersSize(&num, &size); if(size == 0) return -1; // Failure
pImageCodecInfo = (ImageCodecInfo *)(malloc(size)); if(pImageCodecInfo == NULL) return -1; // Failure
GetImageEncoders(num, size, pImageCodecInfo);
for(j=0; j<num; ++j){="" if(wcscmp(pimagecodecinfo[j].mimetype,="" format)="=0" ){="" *pclsid="pImageCodecInfo[j].Clsid;" return="" j;="" }="" for
=""
="" -1;
}
="" menu="" write
=""
void="" cjanelaview::ongravar()="" {
="" cjaneladoc*="" pdoc="GetDocument();
" cfile="" arquivo;
="" arquivo.open("textando.txt",="" cfile::modecreate="" |="" cfile::modewrite);
="" arquivo.write(pdoc-="">texto,pDoc->texto.GetLength());
arquivo.Close();
CPaintDC dc(this); // device context for painting
using namespace Gdiplus;
Graphics graphics(dc.m_hDC);
Pen blue (Color(255, 0, 0, 255)); Pen red (Color(255, 255, 0, 0)); int y = 256;
for (int x = 0; x < 256; x += 5){
graphics.DrawLine(&blue, 0, y, x, 0);
graphics.DrawLine(&red, 256, x, y, 256);
y -= 5; }
for (y = 0; y < 256; y++){ Pen pen(Color(y, 0, 255,0));
graphics.DrawLine(&pen, 0, y, 256, y);
Sleep(20); }
for (x = 0; x < 256; x++){ Pen pen(Color(x, 255, 0, 255));
graphics.DrawLine(&pen, x, 100, x, 200);
Sleep(20); }
// Write window ----> Image Im(L"fig.gif", FALSE); //
CLSID GifCodec;
GetCodecClsid(L"image/jpeg", &GifCodec);
Im.Save(L"gif.jpg", &GifCodec, NULL);
}
|
|
|
|
|
I use OpenIL for all my image reading and writing. OpenIL supports writing .jpgs and .gifs (and many other formats), though it really helps to be familiar with some OpenGL since OpenIL is sturctured very similarly.
There are quite a few image libraries out there that can handle what you want, so you shouldn't have to reinvent the wheel.
|
|
|
|
|
I need help using scripts in VC++.Net. I am having trouble with the #using mscorlib.dll it says that I need /clr. I don't quite understand how to declare and initialize a string either. I am very new to programming, and would appreciate any help.
Thanks,
Jim
|
|
|
|
|
What's the best method for having resizable boxes that can display images imported by a user?
halblonious
|
|
|
|
|
can you say more ?
resizing an image : there are a number of algo. that does that. you can also use CDC::StretchBlt.
resize the box : CWnd::MoveWindow in response to a WM_SIZE of the view.
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
IF you are on Win2k/XP you have a built-in ready-made solution free of charge:
ShellExecute(NULL,"open","rundll32.exe","C:\\WINDOWS\\System32\\shimgvw.dll,ImageView_Fullscreen c:\\yourimage.jpg",NULL,SW_SHOWNORMAL);
This runs a helper exe (rundll32.exe) which does not do anything except running the specified function from the specified dll which show your pic in the image viewer. The same thing happens when you click on an image file (if Office is not installed, Office registers its own image viewer, but you are free to run shimgvw.dll on your own even then)
Bunburry
|
|
|
|
|
I've got an open source game that's a port of the board game Settlers of Catan, and it uses OpenGL in a CView for the game rendering and GDI over that for information display and user interaction. The game is available at http://www.settlers3d.net and the source is all at SourceForge.net under the project 'settlers3d'.
I am now in the process of adding a brand-new expansion to the game and I want to have a separate 3D rendering of the progress of a certain ship piece over a certain tile (called the 'barbarian attack' in the game). This rendering will be informational only and totally static, meaning the users can't interact with it like they do the main CView OpenGL window.
I'm trying to create a new CWnd based OpenGL window for this barbarian attack that is displayed in its own area that overlays the OpenGL CView. (It actually slides in and out from the side of the game window, but that's extemperaneous to the problem.) I have created the new OpenGL CWnd and gotten it to display what I want, however, all of the Windows GDI drawing is now very messed up. Here is a screenshot.
It seems that with the OpenGL CWnd turned on, something is messed up with the display contexts for all of the GDI drawing. If I comment out the Create() call for the OpenGL CWnd, everything works properly again. If I move the application window around with the mouse, the GDI snaps back into correct drawing, but as soon as I do something in the game that changes the GDI information displays, nothing updates properly.
Does anyone have any idea what would cause this? I don't want to clutter up the question with massive source code pastes, but I can post some links to the files on SourceForge if it would help.
|
|
|
|
|
Question #1: How can I create a list of Themes installed in Windows XP? (Similar to the list which appears in Display Properties > Themes).
Question #2: How can I programatically switch between, or apply, a theme to the system? (Without using ShellExecute to bring up Display Properties).
Is there an API for accomplishing these tasks? If not, any ideas of how to do it anyway?
I'm using Visual C++ 6 (or Visual C++ .NET). Thanks in advance!
|
|
|
|
|