|
Thank you.
I think I'll use a virtual mode.
|
|
|
|
|
Hi,
I've created an extension dll to export a class. The class
contains some member functions that take a CString argument or return a CString. The class looks like this:
class AFX_EXT_CLASS FuncObject
{
public:
CString GetFuncValue() const;
int LoadExecutable(const CString& fileName);
private:
};
In the application that uses the dll I have an object of type FuncObject where I call the member function LoadExecutable(). When I try to compile the application I get the linker error 'error LNK2019: unresolved external symbol CString FuncOject::LoadExecutable(...)'. This only happens to member functions that use CStrings. If I use char* instead of CString the problem goes away. Can someone explain this ?
|
|
|
|
|
Just curious, your LoadExecutable() as per FuncObject.h returns int, where as the link error says it cannot find LoadExecutable(...) which is returning a CString !
suhredayan There is no spoon.
|
|
|
|
|
Sorry, the error message should be 'unresolved external symbol int FuncObject::LoadExecutable(...)'
|
|
|
|
|
Hi all,
can anybody tell me how can I pain only a selected area(or region) from a bitmap?
what i mean is that:
1- I have a bitmap picture in a CBitmap
2- I do not want to draw the whole bitmap
3- I want to choose an area like an ellipse or a complex region to draw
4- I want to pick-up those pixels in the bitmap and draw them on a window DC
Any Ideas are welcome
Mohammad Gdeisat
A candle looses nothing by lighting another candle
|
|
|
|
|
Have you looked at the CRgn class?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Hi,
Im working with the AVI Files for a project which records real time video and audio. I was wondering if there is something that could help me to determine the health of Mic and Camera, without actually looking at the Video or listening to the Audio.
(May be I can parse through the AVI file for header chunks or Data chunks, but I am not sure about what I should be looking for )
Thanks!
Abilash G. Sanam
|
|
|
|
|
I have an unmanaged C++ application and want to use managed C# forms. Converting the code to managed code and rewriting in C# are not options. Somehow I think that the CComPtr is a key but am not sure how to use it. Can anyone help?
-Erik
|
|
|
|
|
I guess you can make a COM wrapper for your C# forms and then use them from unmanaged C++.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
How can I set specific color for my window (toolbar)?
Thanks a lot in advance, bilas.
|
|
|
|
|
Is it possible to add icons to the resource file dynamicly? What I would like to do is to allow the user to paint his own icons, name them using some given convention, and use them as icons in a CTreeCtrl. the reason I want to do that is because I don't want to have to recompile my program for each set of icons (and for each user.)
In Java, I could do that easely, using the ImageIcon class. All you need is a URL for where the image is located. I can call the ImageIcon(URL location) constructor, and then use my icon anywhere I want. Is there any way to achieve something like that in VC++?
Thanks for your help,
/Uzi
|
|
|
|
|
hey,
If you mean select icons from directory you can try out this:
//get all icons in a directory
WIN32_FIND_DATA DataFind;
char SearchValue[MAX_PATH];
strcpy(SearchValue, W2A(DirectoryPath));
if (SearchValue[strlen(SearchValue)-1] != '\\' && SearchValue[strlen(SearchValue)-1] != '/')
strcat(SearchValue, "\\");
strcat(SearchValue, "*.ico");
// start file listing
HANDLE hFile = FindFirstFile(SearchValue, &DataFind);
if (hFile == INVALID_HANDLE_VALUE)
return 0;
CComBSTR Filename;
do
{
if (!(DataFind.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
Filename.AppendBSTR(DirectoryPath);
Filename.Append(A2W(DataFind.cFileName));
HICON icon = (HICON) LoadImage(NULL, W2A(Filename),IMAGE_ICON,16,16,LR_LOADFROMFILE);
if(icon != NULL)
{
m_ImageList.AddIcon(icon);
index++;
}
}
}while(FindNextFile(hFile, &DataFind));
FindClose(hFile);
|
|
|
|
|
i am poor in english.... plz tyr to understand.. thanks
hai all,
i Create an arrow Control, i add this control to the web page , i used a logic to draw an arrow as mouse down starting drawing,and mouse up for ending of line i place the arrow tip at ending point.
but in design time i failed to draw exactly what i need.
because i want exactly the windows vb line control...
but any third party tool will take more edge points..
any one tried to get two points at design time..
plz help me, i wrote in vc++6.0 and i am trying to export to vc++7.0 .. so plz help me ...
surya.. .
|
|
|
|
|
I have been trying to track dowm the memoru leaks reported when my application ends;
Detected memory leaks!
Dumping objects ->
thrdcore.cpp(311) : {1254} client block at 0x01954958, subtype c0, 68 bytes long.
a CWinThread object at $01954958, 68 bytes long
Object dump complete.
The program '[1564] My_Example.exe: Native' has exited with code 20 (0x14).
I have included the following statements to help track down the leaks:-
Inserted in the main .cpp file
// Memory leak detection
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#include ".\ssic_exampledlg.h"
// End of Memoy Leak detection stuff
Inserted on the Close event
// Determine where the memory leaks are
_CrtDumpMemoryLeaks();
But cant seem to determine the cause of the leaks!
Any suggestions?
|
|
|
|
|
|
In this SPECIFIC case, you are not deleting the CWinThread object that has been returned by your call to AfxBeginThread or otherwise. In many cases, the CWinThread object does not delete itself when the thread terminates, although you can set a member variable so that it will do so.
It is better to detect that the thread has terminated and then delete the CWinThread object from your program's main thread.
If you don't want to bother tracking the object, then
CWinThread::m_bAutoDelete<br />
Specifies whether the CWinThread object should be automatically deleted at thread termination.
set the member variable TRUE after the call to AfxBeginThread, and hopefully the thread does not terminate before you can set the member, otherwise, create the thread suspended, set the member variable, then resume the thread.
AfxBeginThread - dwCreateFlags <br />
Specifies an additional flag that controls the creation of the thread. This flag can contain one of two values: <br />
CREATE_SUSPENDED Start the thread with a suspend count of one. Use CREATE_SUSPENDED if you want to initialize any member data of the CWinThread object, such as m_bAutoDelete or any members of your derived class, before the thread starts running. Once your initialization is complete, use CWinThread::ResumeThread to start the thread running. The thread will not execute until CWinThread::ResumeThread is called.
|
|
|
|
|
Hi,
I am trying to display a 12-bit TIFF image in an MFC application. How can I do this? I tried using SetDIBitsToDevice(), but it takes a bitmap header structure as input, and the bitmap header structure does not support 12-bit images. Can anyone help me out?
Thanks,
Ajay
|
|
|
|
|
I would look at the CxImage[^] article here on codeproject. That loads in and displays Tiffs, Jpegs, etc.
Iain.
|
|
|
|
|
Thanks!! I already have CXImage, but it does not support 12-bit TIFF images.
Any idea how to display them?
Thanks,
Ajay
|
|
|
|
|
Sorry. As CxImage uses another libary to load tiffs, you might want to see if that
tifflib works with 12bit tiffa. Then you may be able to work with that. But that is
the end of my limited idea.
Iain.
|
|
|
|
|
Hi am an MFC newbie and am getting problems into displaying an animation in an MFC MDI window. The problem is that i have loaded a 3ds model into it and i want to move it when either the computer is idle or when a user activate a button. Please help!!
|
|
|
|
|
|
BlackDice wrote:
isn't there a message for Onidle()?
Uhh no. OnIdle() is called whenever there isn't a message...
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"
|
|
|
|
|
So any suggestion about how to proceed?
|
|
|
|
|
Sorry, I don't know much about animation
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"
|
|
|
|