15,886,199 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Guru_C++ (Top 79 by date)
Guru_C++
29-Apr-13 1:59am
View
yes.. It solved me.. Thank you.
Guru_C++
19-Feb-13 2:07am
View
No.. hWnd is the handle of the Main MFC application window. I will try to find the window of the CTab1Dlg.. Is there any API's to find the window of Property pages ? Am not sure, Recently i 've learnt the Property pages & implementing it .
Guru_C++
14-Feb-13 5:50am
View
How to write that WM_PRININT messages. I dont have any idea about that..
Guru_C++
13-Feb-13 6:42am
View
ok Thank you,.. I will check it out :)
Guru_C++
13-Feb-13 5:17am
View
Hello Maxim, Thanks for replying.. I modified this code as per as your suggestion. The snippet code looks like this:
void ScreenShot()
{
IDirect3DDevice9* pDirect3DDevice;
IDirect3DSurface9* pRenderTarget=NULL;
IDirect3DSurface9* pDestTarget=NULL;
D3DDISPLAYMODE d3ddisplaymode;
D3DPRESENT_PARAMETERS PresentParams;
memset(&PresentParams, 0, sizeof(D3DPRESENT_PARAMETERS));
PresentParams.Windowed = TRUE;
PresentParams.SwapEffect = D3DSWAPEFFECT_DISCARD;
IDirect3D9* direct=Direct3DCreate9(D3D9b_SDK_VERSION);
direct->CreateDevice(D3DADAPTER_DEFAULT,
D3DDEVTYPE_HAL,
GetDesktopWindow(),
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&PresentParams,&pDirect3DDevice);
if (pDirect3DDevice == NULL)
return;
HRESULT hr = pDirect3DDevice->GetRenderTarget(0, &pRenderTarget);
hr = direct->GetAdapterDisplayMode(D3DADAPTER_DEFAULT,&d3ddisplaymode);
hr = pDirect3DDevice->CreateOffscreenPlainSurface(d3ddisplaymode.Width,d3ddisplaymode.Height,D3DFMT_A8R8G8B8,
D3DPOOL_SYSTEMMEM,
&pDestTarget,
NULL);
pDirect3DDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pDestTarget ) ;
hr = pDirect3DDevice->GetRenderTargetData(pRenderTarget,pDestTarget);
hr = D3DXSaveSurfaceToFile("E:\\abc.bmp",
D3DXIFF_BMP,
pDestTarget,
NULL,
NULL);
pRenderTarget->Release();
pDestTarget->Release();
}
But Still i use to get black image .. I dont know whats wrong is happening :(
Guru_C++
13-Feb-13 2:42am
View
I was able to figure out where is the problem, I came to know that I've not created the device. I changed the code like this:
// globals
LPDIRECT3D9 g_pDirect3D = NULL;
LPDIRECT3DDEVICE9 g_pDirect3D_Device = NULL;
IDirect3DDevice9* g_pd3dDevice ;
void CaptureScreen()
{
g_pDirect3D = Direct3DCreate9(D3D_SDK_VERSION);
D3DPRESENT_PARAMETERS PresentParams;
memset(&PresentParams, 0, sizeof(D3DPRESENT_PARAMETERS));
PresentParams.Windowed = TRUE;
PresentParams.SwapEffect = D3DSWAPEFFECT_DISCARD;
g_pDirect3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL ,hMainWnd,D3DCREATE_SOFTWARE_VERTEXPROCESSING, &PresentParams,&g_pDirect3D_Device);
IDirect3DSurface9* pSurface;
g_pDirect3D_Device->CreateOffscreenPlainSurface(100, 100,
D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &pSurface, NULL);
g_pDirect3D_Device->GetFrontBufferData(0, pSurface);
D3DXSaveSurfaceToFile("E:\\Desktop.bmp",D3DXIFF_BMP,pSurface,NULL,NULL);
pSurface->Release();
}
This prevents the Access Violation error after creating the Device. But the Image is in black color. Am i missing it out somewhere.. Please point out me if am wrong..
Guru_C++
15-Jan-13 4:11am
View
yeah.. I have created two threads like this..
UINT Thread1(LPVOID lParam)
{
while(1) {
//Code for Open Operation..
}
return(1);
}
UINT Thread2(LPVOID lParam)
{
while(1)
{
//Code for Close Operation..
}
return(1);
}
void CTradingPlatform : OnBnClickedOPEN()
{
AfxBeginThread(Thread1,0);
}
void CTradingPlatform : OnBnClickedCLOSE()
{
AfxBeginThread(Thread2,0);
}
Now this works fine.. Thank you..
Guru_C++
15-Jan-13 2:30am
View
I've solved it myself .. Anyhow after a lot search on Tesseract, Finally am able to use Tesseract now.
Guru_C++
12-Dec-12 5:04am
View
I tried type casting like this..
lpszEnd =(TCHAR*) _tcschr(s, _T(' '));
It worked fine.. And am getting exact output..
Thank you..
Guru_C++
12-Dec-12 4:55am
View
Thanks for replying... But am getting this error: error C2440: '=' : cannot convert from 'const char *' to 'LPTSTR' on this line
lpszEnd = _tcschr(s, _T(' '));
Guru_C++
27-Nov-12 0:46am
View
Woh !!! Great :) It worked... Thanks Andrew..
Guru_C++
16-Nov-12 4:19am
View
Hi Eugen.. Thanks a lot for giving a hint. I guess i found the solution as u suggested to use ::IsWindowVisible(). My code looks like this:
CWnd *cwnd = NULL;
cwnd = FindWindow("SunAwtDialog","Add Open Deal");
BOOL isTrue = cwnd->IsWindowVisible();
Now.. If Add open Deal window is opened, isTrue variable contains 1.. If not opened isTrue contains 0. Based on this i can do operations on Add Open Deal window.
Thanks a lot :)
Guru_C++
16-Nov-12 3:01am
View
I used the first method i.e., assigning the hwnd variable to NULL ..The result was same.. And, i used the Spy tool to check the Window name & Class name, later i came to the class name i.e., SunAwtDialog. Now the code looks like this..
HWND hwnd = NULL;
hwnd = ::FindWindow("SunAwtDialog","Add Open Deal");
The Result is same. Eventhough the Add Open Deal is closed, hwnd contains valid address..
Guru_C++
16-Nov-12 2:22am
View
Hello Eugen.. Thanks for helping.. In my application, First window (i.e., Wing Fung ) is not pro-grammatically created. Its just like third party application. Then how to use CYourFirstWnd code ? am not getting it..
Guru_C++
4-Oct-12 0:39am
View
Thank you Chuck :)
Guru_C++
3-Oct-12 9:42am
View
Thanks Chuck .. Really i have no idea about the threads am beginner in that.. Please suggest me How do i Properly create a thread & Terminate it..
Guru_C++
29-Sep-12 6:38am
View
Thanks Wang.. But am facing a problem over here.. In Take_Screenshot() 'm just displaying a message box for testing purpose. But 'm unable to run it continuously. I mean only one time i used to get the message box, next time when control comes to gcPtr<cmfc2dlg> obj = new Cmfc2Dlg(); I used to get the error called:
Windows has triggered a breakpoint in mfc2.exe.
This may be due to a corruption of the heap, which indicates a bug in mfc2.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while mfc2.exe has focus.
The output window may have more diagnostic information.
Is there any problem with this code ?
Guru_C++
29-Sep-12 6:10am
View
Is this Correct..?? What am using here ?
void AddRef()
{
InterlockedIncrement (&refVal);
}
void ReleaseRef()
{
InterlockedDecrement (&refVal);
if(refVal == 0)
delete [] this;
}
Guru_C++
29-Sep-12 6:03am
View
Thanks Wang.. I was not knowing it was not safe.. Can u suggest me How to use InterlockedIncrement /InterlockedDecrement ??
Guru_C++
31-Aug-12 5:09am
View
sorry.. I dint understood..
Guru_C++
29-Aug-12 8:49am
View
Oh..! Thank you for the help..
Guru_C++
29-Aug-12 1:07am
View
Thank you.. This is also fine. Now am having clear idea..
Guru_C++
29-Aug-12 1:05am
View
Thanks Jochen.. It is perfect .. ANd.. I dint confused.. It is working fine..
Guru_C++
28-Aug-12 7:18am
View
yes.. I tried it.. But still error : "error C2276: '&' : illegal operation on bound member function expression".
Guru_C++
20-Jun-12 1:08am
View
Bascically am working on Project Trading application, if BUY price is less than or equalls to SELL price. I need to open the both confirmation windows by clicking both BUY & SELL buttons at the same time. Suppose, first if i click SELL button & then if i click BUY button during that time the price will be moved up.. So i tried to click at the same time. I was not sure it is possible or not. So i asked..
Guru_C++
1-Jun-12 1:50am
View
Thanks... Let me try on this..
Guru_C++
31-May-12 10:01am
View
I applied cvFindcountour() to image... I can Draw countours or like boundary line on numbers. But how do i retrieve the numbers to my application.. Is their any library for that ?
Guru_C++
31-May-12 9:07am
View
I tried this.. But am not getting exactly ..
Guru_C++
28-May-12 1:18am
View
I found an example: regsvr32 "C:\Program Files\Moon Valley Software\CD Ultra\Bin\activex\PlayList.ocx". And what is the path to register the mdivwctl.oca ??
Guru_C++
25-May-12 9:10am
View
My application is saying: This "{EF347A62-BA21-42E4-94A0-1C0A6D7FDFE7}" ActiveX control is missing. AM not getting the name of this control.
Guru_C++
25-May-12 2:11am
View
This link is absolutely what i was looking for http://www.codeproject.com/KB/recipes/OCRwithMODI.aspx.. But when i execute the source code, its giving something Debug assertion failed..
Also, in debug mode, i found that VS2008 creates a breakpoint at the following line in occcont.cpp:ASSERT(IsWindow(pTemp->m_hWnd));
Probably, After googling i found ActiveX control is not registered in ur computer. How do i register ActiveX control in MFC appliction ?
Guru_C++
24-May-12 3:21am
View
Previously my image is in .bmp format that contains some individual prices like Rs 1530.98. Using Image online converter, i converted to .emf format. Now how do i identify the header & individuals records in that ?? And also how can i read that price ? Its really a complex task..!! And, When i open the EMF file in paint , it is same as that of .bmp file ..
Guru_C++
24-May-12 1:00am
View
Thank you for replying..Really am in need of the answer.. Sure i will learn about steganography. And, If an image is an EMF file, then how can i read the contents of the image file. Can anyone explain about this..? Waiting for reply ..
Guru_C++
2-May-12 0:28am
View
Sorry.. Am not getting any answer..
Guru_C++
2-May-12 0:28am
View
Sorry.. Am not getting any answer..
Guru_C++
27-Apr-12 0:54am
View
Thank you.. It works fine... But if the setup.exe is run as administrator, then also CreateProcess wii=ll return 0 status.. Am not getting why it happens with Run as administrator..
Guru_C++
27-Apr-12 0:03am
View
FIND_PROC_BY_NAME: It determines whether the process is running or not.. If it is running then it returns 1 or else 0.
Guru_C++
27-Apr-12 0:02am
View
Yes.. I can see the setup.exe in task manager
Guru_C++
23-Apr-12 5:14am
View
yes.. Now it is working fine ..
Guru_C++
20-Apr-12 7:15am
View
Yes i tried that link.. Only progress bar is displaying.. No marquees..
Guru_C++
20-Apr-12 6:34am
View
Am not getting how to use marquee style in progress bar :(
Guru_C++
20-Apr-12 6:00am
View
As per as ur suggestion.. i used Progress bar like this..
HWND hProgressBar = NULL;
hProgressBar = CreateWindow(PROGRESS_CLASS, NULL, WS_CHILD | WS_VISIBLE,10, 20, 150, 20, hWnd, (HMENU)10001, hInstance, NULL);
But this code Does not make use of Visual styles like marquee mode..
Please can u tell me how to use progress bar in marquee mode ..
SendMessage(hProgressBar, PBM_SETRANGE, 0, MAKELPARAM(0, 100));
SetTimer(hWnd, 1, 1000, NULL);
SendMessage(hProgressBar, PBM_SETPOS, (WPARAM)100, 0);
Guru_C++
20-Apr-12 5:21am
View
Sorry... Dint got :(:(
Guru_C++
20-Apr-12 0:41am
View
This is Window based application.. I want it in Console application..
Guru_C++
16-Apr-12 8:43am
View
Hey.. Thank you so much..:)
Guru_C++
4-Apr-12 2:02am
View
char* temp=buffer2;
int buff_len=strlen(temp);
for(int i=buff_len;i>0;i--)
{
temp[i]='\0';
if(i==43)
break;
}
With this code, if i rename the "gscanner.exe" to some other name.. Then it wont work..
Guru_C++
4-Apr-12 1:56am
View
Actually, i want to generate the text file in Debug Folder.. So i need the path like this c:\Users\guruprasad\Desktop\gscanner\Debug\
So i want to remove the string "gscanner.exe"
Guru_C++
4-Apr-12 1:49am
View
Yes.. I want to remove or truncate the string "gscanner.exe"..
Guru_C++
2-Apr-12 8:40am
View
Thank you.. It is working..
Guru_C++
2-Apr-12 7:59am
View
Actually, In my Tool_a.exe Application, I have to Encrypt the Contents of the File.. And in Tool_b.exe application, I have to Decrypt the Contents of the file & it is viewed by only autheticated users.. So Am trying to Decrypt it..
Guru_C++
21-Mar-12 7:26am
View
Actually i applied to Hidden & System to .txt file, So it was still visible.
But when i used like this:
char Path[]="E:\\MyDirectory123";
BOOL success;
success = CreateDirectory(Path, 0);
SetFileAttributes("E:\\MyDirectory123",FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM);
Now MyDirectory123 is not Visible.Now my problem is solved. I guess Hidden & System attributes applies to Folder.
Thank you so much for helping.
Guru_C++
21-Mar-12 6:56am
View
Am using like this :
SetFileAttributes("E:\\new_locking.txt",FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM);
Now also the file is visible..
Guru_C++
21-Mar-12 6:28am
View
yes i used like this:
rename("E:\\locking.txt","E:\\new_locking.txt");
SetFileAttributes("E:\\new_locking.txt",FILE_ATTRIBUTE_HIDDEN);
After this, the file new_locking.txt will be hidden..
But when i go to Folder options->tools->view->Show hidden files. new_locking.txt file will be displayed. But it doesn't happen in the case of bat file. Any suggestion for this ?
Guru_C++
21-Mar-12 5:37am
View
Am having a lock.bat file that works exactly like folder lock.
lock.bat code is like this:
cls
@ECHO OFF
title Folder Locker
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Locker goto MDLOCKER
:CONFIRM
echo Are you sure u want to Lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Locker "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Enter password to Unlock folder
set/p "pass=>"
if NOT %pass%==type your password here goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Locker
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Locker
echo Locker created successfully
goto End
:End
Can anyone tell me, How can i do it in WIN32 ?
Guru_C++
19-Mar-12 6:38am
View
Ok.. Can u provide any usefull links to block all the readings from Drive using WIN32 Programmatically.
Guru_C++
19-Mar-12 5:05am
View
Yes.. I agree with this point. We can block all writing to D:Drive or block all reading from I:Drive.
Just assuming that, In I:Drive am having three .txt files. And, If we made block all reading from I:Drive, Can i copy all three .txt files to Other Drives ?
Guru_C++
19-Mar-12 3:55am
View
Actually.. Using WIN32 Programmatically, i want to make I:Drive as Copy Protect that is,The files in I:Drive should not copy to Other Drives. Am not sure can it be done like this ? Am having lot confusion about this concept, because all drives will be under Device Drivers control.. If i want to achieve this, Should i need to change Device Drivers program or what ??
Guru_C++
14-Mar-12 8:33am
View
Ok.. Thanks alot..
Guru_C++
14-Mar-12 3:20am
View
But how to avoid the Garbage value...! Am getting like this abcdefÌÌ
Guru_C++
14-Mar-12 3:09am
View
Woh...!! Cool.. It is working.. Thanks alot...
Guru_C++
14-Mar-12 2:06am
View
Atleast, Can it be done for External USB or Flash Disk ??
Guru_C++
12-Mar-12 5:37am
View
Yes.. Ur right.. In basic file attributes we don't have such options.
Guru_C++
12-Mar-12 5:00am
View
Is there any way to make it Programmatically with out using User Account Control Features..
Guru_C++
12-Mar-12 0:38am
View
After combination of all these, The file becomes Read only.. Can't chage the contents of the file.. But we can copy that file to some other location.. But how we can avoid that..! Suggest me..
Guru_C++
10-Mar-12 1:50am
View
So.. What i need to Pass for dwShareMode ..To make file as non-exclusive mode..
Guru_C++
10-Mar-12 1:49am
View
i dont want user to copy that file to some other location ..
Guru_C++
9-Mar-12 7:56am
View
And, Also i searched about LockFile in MSDN.. Can anyone tell me how to use that LockFile function..
Guru_C++
9-Mar-12 7:18am
View
Sorry... Din't got :(
Guru_C++
8-Mar-12 7:21am
View
Please, Show me with code..
Guru_C++
6-Mar-12 23:46pm
View
Thank you so much... It had worked....:)
Guru_C++
6-Mar-12 8:28am
View
I have used the ReadFile function, but actually it doesn't help me to retrieve the data .. Actually i need data from the File ...
Guru_C++
30-Jan-12 7:56am
View
Thanks..
Guru_C++
30-Jan-12 7:48am
View
Nope.. I dont want to copy whole output directory.. I need to copy only .exe file in Test computer.. So,,
Guru_C++
30-Jan-12 7:45am
View
Thank you for helping :)
Guru_C++
25-Jan-12 7:54am
View
Yes ur correct.. And, Also am derefrencing a null pointer. But, am not getting how to modify the code..
Guru_C++
25-Jan-12 3:08am
View
Yes John.. Its boolian pointer..
Guru_C++
25-Jan-12 2:17am
View
I changed my code as per as ur suggestion.. Still a getting same error..:(
Guru_C++
25-Jan-12 2:05am
View
Thanks for your help :) Function Declaration for GetSerialNumber is like this:
typedef BOOL (WINAPI *GetSerialNumberDLL)(CHAR* , CHAR );
Guru_C++
17-Nov-11 4:22am
View
Hey ! Tkanks for replying the answer.. It helped me alot ..
Show More