|
HI all,
I have an ListCtrl on FormView with Reportview type.
i m using a CheckListBox in diffrent dialogbox.
in form view on button clicked event i m calling the dialog box that is having CheckListBox .
i want to add all columns heading of Listctrl in the CheckListBox when the dialogbox called.
please tell me how can i do this.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi,
Is there any conflict betwwen ws_clipsibling and cs_parentdc style.if any please suggest.
Thanks in advance
|
|
|
|
|
hi every1,
I am new to VC++, Right now am looking for an sample to understand proces creation and synchronisation mainly ...but not getting a proper one...could u pls guide me trough?
thnks
Himangshu
|
|
|
|
|
What about reading the documentation [^], [^]?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thx pallani...I will go through it now....If any doubt i will post here...Actually i was not able to run any exe created under a particular directory...may be systax wrong....Himangshu
|
|
|
|
|
hi again,
Am not able to run a simple txt file...Could u pls look through my code..
BOOL bWorked;
STARTUPINFO suInfo;
PROCESS_INFORMATION procInfo;
CString m_Process = "D:\\docs\\aa.txt";
char *vip = "D:\\docs\\aa.txt";
"whatever command line arguments here";
memset (&suInfo, 0, sizeof(suInfo));
suInfo.cb = sizeof(suInfo);
bWorked = ::CreateProcess(m_Process,
NULL,
NULL,
NULL,
FALSE,
NORMAL_PRIORITY_CLASS,
NULL,
NULL,
&suInfo,
&procInfo);
Pls help..
Thax
|
|
|
|
|
From CreateProcess documentation [^], about its first argument
lpApplicationName [in, optional]
The name of the module to be executed.
while you're passing a text file, that is NOT an executable module.
If you wish the Windows OS choosing the appropriate executable to open your text file than have a llok at ShellExecute [^] instead.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thx pallani.....i didnt notice that it can execute only exe....
Thanks alot,
Himangshu S
|
|
|
|
|
therez one more thing if u could help me out with..Actually, i want to learn how to make a new driver using VC++,...Could u pls refer me some link or any docs.....?
Regards,
Himangshu
|
|
|
|
|
Hi,
I have a problem with RegQueryValueEx.I am trying to remove the excel addin entry present in the registry. In the below key(office 2007) OPEN,OPEN1,OPEN2 ..and so on will contain the installed addin path on your excel.
HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Options
Eventhough there is a value against OPEN1,OPEN2, RegQueryValueEx is not retrieving value.But return value of RegQueryValueEx is 0 which means that processed successfully.
CString str;
int count = arAddin.GetSize();
for(int nIndex=0;nIndex<count;nIndex++)
{
str = arAddin.GetAt(nIndex);
if(RegQueryValueEx(hKey,(LPCTSTR)str,NULL,&dwType,buff,&dwSize)==ERROR_SUCCESS)
{
AfxMessageBox((LPCTSTR)buff);
}
Please help me.
|
|
|
|
|
SRKSHOME wrote: RegQueryValueEx is not retrieving value
- What do you mean exactly with the above words?
- What is buff content?
- What is dwSize value?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
My worry is why RegQueryValueEx is not always retrieving the value in buff.
Here buff is unsigned char buf[512] and dwSize value is sizeof(DWORD);
|
|
|
|
|
You should set dwSize=512 before calling RegQueryValueEx .
BTW My question were about buf and dwSize return (after RegQueryValueEx call happened) values.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Make sure you reset dwSize to be the size of buff for each iteration of the loop.
|
|
|
|
|
Does this code set the buffer to \0\0\0\0?
memset(HartSendBuffer,'\0',4)
thanks
|
|
|
|
|
|
Yes and memset(HartSendBuffer,0,4) does the same.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
yes it does... but you would have used your debugger and you'd have figured that out yourself
|
|
|
|
|
while using Threads against Multimedia timer when stoping threads in function i got Following Exception
First-chance exception in Nova.exe(NTDLL.DLL):0xC00000008:Invalid Handle
the code in method is
void Cvep::stoprecThread()
{
KillTimer(4);
KillTimer(5);
CSingleLock lock1(&c_s0);
lock1.Lock();
recflag=0;
lock1.Unlock();
PatternsFinish();
ResumeThread(hand[1]);
ResumeThread(hand[0]);
DWORD lpExitCode0;
DWORD lpExitCode1;
::GetExitCodeThread(hand[0], &lpExitCode0);
::GetExitCodeThread(hand[1], &lpExitCode1);
if(STILL_ACTIVE == lpExitCode1 )
{
WaitForSingleObject(hand[1], INFINITE);
}
if(STILL_ACTIVE == lpExitCode0 )
{
WaitForSingleObject(hand[0], INFINITE);
}
CloseHandle(hand[1]);
CloseHandle(hand[0]);
}
plz help how to resolve this
|
|
|
|
|
- What is the line wherein the error occurs?
- Why don't you check
::GetExitCodeThread return value?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all.
I uesd FSCTL_GET_VOLUME_BITMAP to get free cluster list but When bitmap is very large it can not be fit into buffer, So I tried to read the bitmap in small chunks of bytes but I am always getting the bitmap from startting 0 offset, How could I read bitmap in small chunks.
my code is here, Please correct if i am wrong
BOOL CFreeCluster::GetBitmap()
{
STARTING_LCN_INPUT_BUFFER StartingLCN;
VOLUME_BITMAP_BUFFER *Bitmap = NULL;
ULONGLONG BitmapSize;
DWORD BytesReturned;
BOOL Result;
StartingLCN.StartingLcn.QuadPart = 0;
BitmapSize = sizeof (VOLUME_BITMAP_BUFFER) + 4;
Bitmap = (VOLUME_BITMAP_BUFFER *) malloc (BitmapSize);
HANDLE hHandle=OpenDrive();
Result = DeviceIoControl
(
hHandle,
FSCTL_GET_VOLUME_BITMAP,
&StartingLCN,
sizeof (StartingLCN),
Bitmap,
BitmapSize,
&BytesReturned,
NULL
);
if (Result == FALSE && GetLastError () != ERROR_MORE_DATA)
{
free (Bitmap);
return (false);
}
BitmapSize = (Bitmap->BitmapSize.QuadPart / 8) + 1;
int nBufferSize=8*512*3;
ULONGLONG ullItr=BitmapSize/nBufferSize;
if(BitmapSize%nBufferSize!=0)
ullItr++;
Bitmap = (VOLUME_BITMAP_BUFFER *) realloc (Bitmap, nBufferSize+1);
for (ULONGLONG ullTmp=0; ullTmp < ullItr; ullTmp++)
{
if(BitmapSize < nBufferSize)
nBufferSize=BitmapSize;
StartingLCN.StartingLcn.QuadPart=ullTmp*nBufferSize;
Result = DeviceIoControl
(
hHandle,
FSCTL_GET_VOLUME_BITMAP,
&StartingLCN,
nBufferSize,
Bitmap,
nBufferSize,
&BytesReturned,
NULL
);
BitmapSize=BitmapSize-nBufferSize;
}
}
return (true);
}
|
|
|
|
|
Hi All,
Iam having 3 tree controls.Now i need to access Drag and Drop between 2nd and 3rd only.I need some sample code for this.Its very urgent for me.
Plz help me.........
Thanks & Regards,
Anitha
|
|
|
|
|
For drag & drop you need to OnBeginDrag and OnLButtonUp.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I have coded the following:
---------------------------------------------
//file BT01.h
class BT01
{
public:
int BruteForce(char *P, char *T);
void InputText(char *T, char *P);
};
---------------------------------------------------
//file BT01.cpp
#include "BT01.h"
#include "time.h"
#include "dos.h"
#include <iostream>
#include <conio.h>
#include <stdio.h>
using namespace std;
int BT01::BruteForce(char *P, char *T)
{
//duyet T
for (int i = 0; i <= strlen(T) - strlen(P); i++)
{
//khai bao j
int j = 0;
//duyet P
while (j < strlen(P))
{
//Kiem tra ptu tai T tai vi tri thu i + j co bang j hay khong? xu ly
if (tolower(T[i + j]) == tolower(P[j]))
j++;
else
break;
}
//Tim thay
if (j == strlen(P)) return i;
}
//khong tim thay
return -1;
}
void BT01::InputText(char *T, char *P)
{
do{
printf("T: ");
gets(T);
}
while (strlen(T) < 1);
do{
printf("P: ");
gets(P);
}
while(strlen(P) < 1 || strlen(P) > strlen(T));
}
void main()
{
char *P = new char[20];
char *T = new char[999];
printf("BAI TAP TH01 - THUAT TOAN BRUTEFORCE\n");
BT01 objBT01;
objBT01.InputText(T, P);
int kq;
kq = objBT01.BruteForce(P, T);
if (kq == -1)
printf("KQ: Khong tim thay.");
else
printf("\nKQ: %i, %i", kq, strlen(T));
printf("\nThoi gian (ms): ");
getch();
}
I would like to count time for Algorithm BruteForce. How to count?
modified on Monday, December 22, 2008 11:00 PM
|
|
|
|
|
I'm not sure what you mean by "count time". If you mean algorithmic complexity, the worst case running time would be O((T - P + 1) * P) because that's the maximum number of times the loops in BruteForce together can execute. A little calculus also shows that the worst occurs when P = (T + 1) / 2, in which case the running time would be O(T2).
If you're looking to calculate the actual running time of the function, you should use a library function such as clock()[^] to get the time before and after calling the BruteForce function - then the difference in those times will give you the execution time.
|
|
|
|