|
You mean a DIBSection ? You want to free the memory, or draw over it ?
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
My save dib code is this : first, I create a bitmapfileheader then i write data to the bitmapfileheader .
Here is the actual code // if we have no data , we cannot save
if (m_pDib==NULL)
return(false);
CFile cf;
// attempt to create the file , CFile::modeCreate Directs the constructor to create
//a new file. If the file exists already, it is truncated to 0 length.
//CFile::modeWrite Opens the file for writing only, &= AND assignment
if(!cf.Open(pszFilename,Cfile::modeCreate &= CFile::modeWrite))
return(false);
//write the data
try{
//first create a bitmapfileheader
//with the correct data
BITMAPFILEHEADER BFH;
memset( &BFH,0,sizeof( BITMAPFILEHEADER ));
BFH.bfType ='MB';
BFH.bfSize = sizeof(BITMAPFILEHEADER) + m_dwDibSize;
BFH.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + m_nPaletteEntries * sizeof(RGBQUAD);
//write the bitmapfileheader and dib data
cf.Write( &BFH , sizeof( BITMAPFILEHEADER ));
cf.Write( m-pDib, m_dwDibSize ));
Then what code should i put to destroy the dib ?
|
|
|
|
|
Why not 'delete m-pDIB' ? I assume it's a pointer ?
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
I get some "Major" problems when I compile in VC++ 6.0 on Win2000?
this is what i get!
Linking...
LINK : error : Internal error during ReadSymbolTable
ExceptionCode = C0000005
ExceptionFlags = 00000000
ExceptionAddress = 78003ABF
NumberParameters = 00000002
ExceptionInformation[ 0] = 00000000
ExceptionInformation[ 1] = 00000000
CONTEXT:
Eax = 4002C874 Esp = 0012E488
Ebx = 00000000 Ebp = 0012E4A0
Ecx = 00000000 Esi = 4002FFC8
Edx = 00000000 Edi = 00000000
Eip = 78003ABF EFlags = 00010246
SegCs = 0000001B SegDs = 00000023
SegSs = 00000023 SegEs = 00000023
SegFs = 00000038 SegGs = 00000000
Dr0 = 0012E488 Dr3 = 00000000
Dr1 = 0012E4A0 Dr6 = 00000000
Dr2 = 00000000 Dr7 = 00000000
Error executing link.exe.
Tool execution canceled by user.
Anny sugestions?
BTW:I did not cancel the execution
|
|
|
|
|
Are you using the latest Visual C++ service pack? (SP4)
I have been using Visual C++ on Win2000 for a year now without any problems.
|
|
|
|
|
Yes I am
Win2k is ghosted with Norton ghost!
I think the problem is ghostrelated??
|
|
|
|
|
I use VC++ with no service pack ( go figure ) on Win2K every day for a year or so. I'd suggest a reinstall, creating an empty project and compiling, checking your includes, etc.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Hello,
While trying to create a Singleton using a COleObjectFactory derived class I stepped into the COleObjectFactory::CreateInstanceLic(..) MFC function. In this function the following lines of code are present
sc = pTarget->InternalQueryInterface(&riid, ppvObject);
if (sc == S_OK)
{
dwRef = pTarget->InternalRelease();
ASSERT(dwRef != 0);
}
My question is what is the sense of calling the Internalrelease() function ? As far as I understand it the release should only be called when the client releases the object.
Could anybody explain this to me please?
Richard
|
|
|
|
|
Hi,
i want to call a function defined in an DLL with a FILE * as parameter, but trying to access the file via
this fileponter i get an access violation. Isn't it possible to pass a filepointer to a dll function, or is there
anything else to do before passing this pointer?
TIA, Chris
|
|
|
|
|
I don't know, what kind of dll's function you used, but
maybe you try use CFile class.
|
|
|
|
|
I'm not sure if this is the answer but from experience I do know that the standard library allocates memeory out of a heap. This heap is maintained by the standard library and your application and it's DLL would each maintain separate heaps. A problem will occur if a heap allocation/deallocation occurs when this FILE * pointer is used. Basically you cannot allocate from the heap in the application then attempt to deallocate from the DLL since the DLL assumes that the memory is in its own heap. I would suggest if possible to use file handles and work with the Win32 API instead of the standard library.
|
|
|
|
|
OK, but i dont know exactly, maybe Win32API HFILE == CFile::m_hFile.
I haven't big experience in Win32 development
|
|
|
|
|
Where possible, have both your EXE and DLL(s) use the dynamic run-time libraries (msvcrt.dll)
instead of statocally linking to the C RTL.
|
|
|
|
|
Hi,
Can anybody help me how to use NetMessageBufferSend function
with the following command lines :
c:\WINT\Net.exe send Computer1 "Goog morning"
c:\WINT\Net.exe send * "Good morning"
c:\WINT\Net.exe send /USERS "Good morning"
c:\WINT\Net.exe send /DOMAIN:MyDomain "Good Morning"
Thanks
|
|
|
|
|
Hi, recently i received a source code which saves dib into a file which is Windows 3.0 DIB format, what I need to know is if this source code is suitable for use in win98? If not can , can anyone show me how to save it to win98 format? Thanks a lot.
|
|
|
|
|
When Classwizard is used to create a new class, it always starts the .h file by
// yourHeaderFileName.h : header file
//
and the .cpp file by
// yourHeaderFileName.cpp : implementation file
//
So my question is : is it possible to change this automation and put for example this text instead ?
// *********************************************************
// File : yourHeaderFileName.h
// Author : xxxxxx
// E-Mail : xxxx@xx.com
// Copyright : xxxxxxxxxxxxxxxxxxxx
// Project :
// Version : 0.1
// Created : 11/21/00
// Summary :
// Modified :
// *******************************************************
Thanks for your help
C U
|
|
|
|
|
Maybe. Search the MSDN library for "Custom AppWizard Files".
"MFCAPWZ.DLL contains the code that controls the default behavior of the MFC AppWizard.
It also contains the code that controls the interactions between the MFC AppWizard and any
custom AppWizards you create ..."
|
|
|
|
|
I have a memory leak in my program. It's a simple c++ program
on unix. To test my memory leak theory, I want to print
out the total current memory at certain points in the
program.
Does there exist a command like 'get current memory' in
c++?
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
danYELL
|
|
|
|
|
Can anyone tell me how to get rid of this error ???
FTPDownLoad.obj : error LNK2001: unresolved external symbol
__imp__InternetGetLastResponseInfoA@12
Release/ftptest.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
thanks
Kim :
|
|
|
|
|
Make sure you have Wininet.lib linked into your project.
|
|
|
|
|
ok i'm a total novice..... ok a dummy ...so how do i do this. I appreciate the help..your a life saver
Kim
|
|
|
|
|
Within Visual Studio do the follwing.
1. Open your project
2. Select Project, Settings from the menu
3. Select the link tab from the Project Settings dialog box
4. In the Category drop down box, select Input
5. In the edit control under Object/Library modules: enter the following:
Wininet.lib
This is where you can add any libraries that need to be linked to your project.
Basically what happens when you see the error "unresolved external symbol" is that your code is using functions or variables included a header file but you did not write the functions or link in the libraries containing the functions.
|
|
|
|
|
Just one note to this,
Changing the linker's options for the Debug build might not necessarily change the options for the release, Or vicea versa,
Although you can change the options for bothe versions at the same time
Regardz
Colin Davies
|
|
|
|
|
To save time add this line to the header file
#pragma comment(lib,"Wininet.lib ")
|
|
|
|
|
Hi all, I need to subclass the scrollbars of a CWnd to customize their appearance. It is almost easy with the scrollbar control placed over a Dialog, but how can it be done with the scrollbars of a Window ???
Thank you all.
Carlo Comino.
|
|
|
|