|
Thanks Nibu thomas
appriciate the help
it's working fine now
|
|
|
|
|
They didn't do the beginners any good with this stupid property-notation in the Hype-languages.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
To Whom it may concer:
I have a serious issue with the development under MS Exchange Database using unmanaged C++. I would really appreciate ( for a bootle of BEAR if you live in Kyiv, Ukraine) if someone can provide me with the documentation and/or samples of such code.
Thank you in advance!
For more info please advice
|
|
|
|
|
hi!! is any1 familiar wiz openGl? I want to integrate terrain codes which r in openGL in MFC n am having sm problem.. cud any1 plz help me
|
|
|
|
|
You could go to the website nehe.gamedev.net/ you will find some good tutorials on opengl at this site.
|
|
|
|
|
adiilah wrote: I want to integrate terrain codes which r in openGL
as mentioned go to Nehe.... if the issue is how to do terrains in OpenGL, go here: http://www.vterrain.org/LOD/Implementations/index.html[^]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
What do you exactly mean by "terrain codes in OpenGL" ?
SkyWalker
-- modified at 14:48 Tuesday 14th March, 2006
|
|
|
|
|
Hello People,
I want to paint the caption bar dynamically with color of my choice. The Font and Color of the Caption Bar text should change.
Besides, I also want to change the border color to match the Caption Bar Color.
Has Anyone done this earlier?
Any help on this?
Sukant Tiwary
|
|
|
|
|
maybe it is some helpful to you
http://www.codeproject.com/dialog/skinedcaptionbars.asp
|
|
|
|
|
After repeated database operations while opening closing a child window of a dialog applications, a message box will pop up saying "Too many client tasks. Driver's SQLSetConnectAttr failed". I am a beginner in mfc/C++ programming and need this program runnning ASAP and any help would be appreciated. thanx
|
|
|
|
|
For every connection that you create, there must be a matching destroy. Why not just create one connection when the application is started, and destroy it when the application closes? Creating a connection to a datasource can be a very costly operation.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
The code given below works fine as long the mouse is on the application dialog,
but as it leaves the dialog mouse position coordinates do not change.
I have set hook as under;
pfnMyMouseMonitor = (HOOKPROC)MouseProc;
hMouseHook = ::SetWindowsHookEx(WH_MOUSE,pfnMyMouseMonitor,(HINSTANCE) NULL, GetCurrentThreadId());
Mouse function is as under
LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lParam)
{
MOUSEHOOKSTRUCT* pms = (MOUSEHOOKSTRUCT*)lParam;
//pms->
if (nCode == HC_ACTION)
{
str.Format("x = %d : y = %d",pms->pt.x ,pms->pt.y);
px->SetWindowText(str); // px is pointer to static control on dialog
}
return(::CallNextHookEx(hMouseHook, nCode, wParam, lParam));
}
I donot want to use dlls.
Thanks in advance.
|
|
|
|
|
u can't put a globel mouse hook unless u put the hook function in a dll.
In this case in order to get the window text below, use
SetCapture()
nave
|
|
|
|
|
The system function call waveInGetPosition retrieves the current input position of the given waveform-audio input device. The function call returns the position in the parameter MMTIME in the given format. (if possible)
In my application I use the TIME_SAMPLES format wich specifies the current position in an offset in samples since the last time the waveform-audio input device was reset.
My question is: What would happen if a recording gets to long (nSamples>(2^32)-1).
I think it just simply wraps around the current position but I am not sure about this. (I have never tried) And it would take me about 12 hours to figure out by myself. (4294967296/96000/3600=12.43)
Thanks.
|
|
|
|
|
Hai to all,
Can anybody understand this function can you please explain me. by using this function the size of the image we are storing is increasing the size. I have to reduce that size. I am unable to find what to do. with out using this function the size of the image is 40kb and after using this function it size become 622kb. I am using Black and while image. I think by reading any image by Gdiplus Image function it will take it into color mode. becoz of that it is taking large size.
If possible can tell me how to reduce the size of the image.
CLogEntry CDocImage::MergeSignRegions(LPCTSTR szSaveFileName, FocusSide nSide ) {
CLogEntry retcode;
CString csError ;
Bitmap *pbmBase = NULL ;
Gdiplus::Image *pImageIn = NULL ;
Status saveStatus ;
// Don't do anything if there is no sign regions for this side.
if ((nSide == Side1 && m_ptaSignRegions.GetSize() == 0) ||
(nSide == Side2 && m_ptaSignRegions2.GetSize() == 0))
return retcode;
TCHAR szTempPath[MAX_PATH] = "\0";
TCHAR szSigTempFile[MAX_PATH] = "\0";
TCHAR szBaseTempFile[MAX_PATH] = "\0";
if ( !::GetTempPath( MAX_PATH, szTempPath ) ) {
VXTRACE();
return CLogEntry("Failed to get temp path.", -1);
}
// Get the number of sign regions of this side
int nSignRegionCount = 0;
if (nSide == Side1)
nSignRegionCount = m_ptaSignRegions.GetSize();
else
nSignRegionCount = m_ptaSignRegions2.GetSize();
// Load the saved document image and merge all signatures
try {
CLSID encoderClsid ;
WCHAR wcFileName[_MAX_PATH*sizeof(WCHAR)] ;
WCHAR wcTempName[_MAX_PATH*sizeof(WCHAR)] ;
WCHAR wcSaveName[_MAX_PATH*sizeof(WCHAR)] ;
LPCTSTR pszFileName ;
CDC memDC, sigDC ; // memory DC into which main image will be loaded
HBITMAP hbm, hbmSig ;
memDC.CreateCompatibleDC( CDC::FromHandle( ::GetDC( NULL ) ) ) ; // .like display.
sigDC.CreateCompatibleDC( CDC::FromHandle( ::GetDC( NULL ) ) ) ; // .like display.
if ( nSide == Side1 )
pszFileName = m_szFilename ;
else
pszFileName = m_szFilename2 ;
//--- Read in document image, as a tif
mbstowcs( wcFileName, pszFileName, sizeof( wcFileName ) ) ;
pImageIn = new Gdiplus::Image( wcFileName, false ) ;
if (!::GetTempFileName(szTempPath, "BAS", 0, szBaseTempFile)) {
VXTRACE() ;
return CLogEntry( _T("Failed to get base temp path"), -1 ) ;
}
// Get the CLSID of the BMP encoder
if ( GetEncoderClsid( L"image/tiff" /*L"image/bmp"*/, &encoderClsid ) == -1 ) {
::DeleteFile( szBaseTempFile ) ;
VXTRACE() ;
return CLogEntry( _T("Cannot find encoder clsid for BMP encoder"), -1 ) ;
}
//--- Save the document image as a bmp
mbstowcs( wcFileName, szBaseTempFile, sizeof( wcFileName ) ) ;
pImageIn->Save( wcFileName, &encoderClsid, NULL ) ;
//--- Reload document as a GDI+ BMP Image
pbmBase = new Bitmap( wcFileName, false ) ;
PixelFormat pxfBase = pbmBase->GetPixelFormat() ;
//--- Put base document bitmap into memory dc
Status status = pbmBase->GetHBITMAP( NULL, &hbm ) ;
memDC.SelectObject( hbm ) ;
CDC adc ; // memory DC for result
CBitmap bmp ; // will contain the composite image
bmp.CreateCompatibleBitmap( &memDC, pbmBase->GetWidth(), pbmBase->GetHeight() ) ;
adc.CreateCompatibleDC( &memDC ) ;
adc.SelectObject( bmp.m_hObject ) ;
//--- Suck the composite image out of the assembly dc, into a bmp that we can use
adc.BitBlt( 0, 0, pbmBase->GetWidth(), pbmBase->GetHeight(), &memDC, 0, 0, SRCCOPY ) ;
CPalette *pPal = memDC.GetCurrentPalette() ;
Bitmap *pSigMap = new Bitmap( (HBITMAP)bmp.m_hObject, (HPALETTE) pPal->m_hObject ) ;
if ( GetEncoderClsid( L"image/tiff", &encoderClsid ) == -1 ) {
VXTRACE() ;
return CLogEntry( _T("Cannot find encoder clsid for tiff encoder"), -1 ) ;
}
//--- Create a 2-parameter array, for Compression and for Color Bit depth
EncoderParameters* pEncoderParameters = (EncoderParameters*) malloc(sizeof(EncoderParameters)
+ 1 * sizeof(EncoderParameter));
//--- Use LZW Compression instead of Group 4, since it works for color and G4 doesn't
ULONG ulCompression = EncoderValueCompressionLZW ;
//--- 24-bit seems to be the SMALLEST one that works here - it might be the image, since
//--- the encoder claims to work for smaller values, but disk space is cheep.
ULONG ulColorDepth = 24L ;
pEncoderParameters->Count = 2 ;
pEncoderParameters->Parameter[0].NumberOfValues = 1 ;
pEncoderParameters->Parameter[0].Guid = EncoderCompression ;
pEncoderParameters->Parameter[0].Type = EncoderParameterValueTypeLong ;
pEncoderParameters->Parameter[0].Value = &ulCompression ;
pEncoderParameters->Parameter[1].NumberOfValues = 1 ;
pEncoderParameters->Parameter[1].Guid = EncoderColorDepth ;
pEncoderParameters->Parameter[1].Type = EncoderParameterValueTypeLong ;
pEncoderParameters->Parameter[1].Value = &ulColorDepth ;
mbstowcs( wcSaveName, szSaveFileName, sizeof( wcSaveName ) ) ;
saveStatus = pSigMap->Save( wcSaveName, &encoderClsid, pEncoderParameters ) ;
if ( saveStatus != Ok ) {
VXTRACE() ;
csError.Format( _T("Bitmap::Save failed for %s, error %d"), szSaveFileName, saveStatus ) ;
return CLogEntry( csError, -1 ) ;
}
} catch ( Exception error ) {
csError.Format( _T("ImageMagick Exception: %s"), error.what() ) ;
retcode = CLogEntry( csError, -1 ) ;
}
//--- can't delete the temporary file used for the Bitmap object while that object still exists
if ( pbmBase )
delete pbmBase ;
if ( pImageIn )
delete pImageIn ;
if ( *szBaseTempFile ) {
if ( !::DeleteFile( szBaseTempFile ) ) {
csError.Format( _T("DeleteFile failed for %s, error %d"), szSigTempFile, ::GetLastError() ) ;
return CLogEntry( csError, -1 ) ;
}
}
VETRACE();
return retcode ;
}
|
|
|
|
|
Every DHCP network has a DHCP server, and every DHCP server has a lease table. Every DHCP Lease table has a correlation of Mac to IP. I want to be able to access the information in the DHCP Lease Table without shutting down services. The Microsoft DHCP management console can do this, and the W2K3 admin pack (installed on a client computer) allows this to happen from a remote computer, so I know it can be done. Not all DHCP servers are Windows machines, some are Routers, some are Linux, etc. So is there a way of accessing the information in the Lease table regardless if it is on a Windows server, router, etc.? Could perhaps output the information to a .csv file in a temp folder for input/review for our program.
|
|
|
|
|
hi friends,
I connect to any website via proxy. But I want to connect to site by bypassing proxy.
for connecting proxy use
INTERNET_OPEN_TYPE_PRECONFIG
from CInternetsession class
I want to connect it without using proxy. kindly give me a reply.
Regards
kedar
Girish
Software Developer
|
|
|
|
|
Hello,
I have a LogIn Form which should close and destroy itself upon verification of password and username.
How can I link the text inputed to be verified from an Access file?.
Also,I want the logIn form to be closed and load a diferent Form (Not CDialog form). Any help is highly appreciated. Tks
new to Visual C++, bt we gonna make it catch-a-fi-er
|
|
|
|
|
Hi Gurus,
I have an ActiveX control that has an Edit control inside. I have embeded this control in IE. the problem is when i try to delete some text in Edit control using backspace key the browser takes me to the previous page instead of Erasing the text in Edit control. Does any one know how to deal with this situation
please its urgent
thanks
Muhammad Azam
|
|
|
|
|
I think it is because the browser gets the events first.
Subclass the Edit control, and you are good to go.
this is this.
|
|
|
|
|
Khan,
could you please ellaborate your point. I am not able to get it.
My ActiveX control contains other controls along with the Edit control.
AZam
|
|
|
|
|
I meant that you could subclass it. Which basically means implementing the WndProc for the control.
The actual code would depend on whether you are using MFC or not. In MFC, it is really easy, as you could just derive a class from CEdit. Then in that class, you can control everything the edit control does, like, handling backspace, Esc etc. In WTL, it is just a little different.
Search this site for the many edit controls:
http://www.codeproject.com/editctrl/[^]
Here, you will find many implementations. Choose the best one for your purpose.
this is this.
|
|
|
|
|
hi,
I need to open an text file to save the output data from the machine, i could open the text file and could write the output data to the text file, but the problem is how could i save the previous test data output if i again run the program?
file = fopen("output.txt", "w+");
...
fputs(txt, file);
fputs("\n", file);
If i run the program, i could write the data of the present running data output, i need to save the old output data for the checking the drift?
Can i use rewind????
Thnaks in advance
|
|
|
|
|
use file = fopen("output.txt", "a+"); to append, see function description in MSDN.
Regards
Ray
"Je Suis Mort De Rire"
Blogging @ Keratoconus Watch
|
|
|
|
|
Open the file for append, "a(+)" instead of "w+".
"w+" always creates the file.
"a" creates the file if it doesn't exist. Else, it adds to at the (previous) end of the file.
|
|
|
|
|