|
Hi,
No lauren ...
I had stupid question, maybe ...
---
About Crystal Report, i got your example, it was very nice ... but my Crystal Report version is 7.0, and you sent to me Crystal Reports header files for version 8.0 ...
Can you tell me, how can i download the header files(peplus.h and peplus.cpp) for Crystal Report 7.0 ???
Thanks again,
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
go to www.crystaldecisions.com and search for files called peplus.*
i found a version for cr vr 6 and cr vr 8 but not 7
maybe ask the tech support people for what version you can use
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Alright I'm trying to intercept the Messages sent to a paticular window like Spy++ that comes with MSVS. I have a DLL file that (I think) starts and stops a global hook. When I start the test program (or step debug the DLL) the messages stop getting sent to the window that i'm blocking, but aren't getting sent to my callback function. I would greatly appericate it if anyone could enlighten me with some help. I can give more info or code if nessacary. Thanks
Alex Waag
alexxwaag@hotmail.com
My Software nerver has bugs, It just develops random features.
|
|
|
|
|
Take a look to samples on MSDN.
Try this "DLL: Windows Message Spy Sample" or "Spy: Monitoring Messages with SPY".
Good luck.
Oscar L.
|
|
|
|
|
I create a dynamic array in a function:
int* pNumber = new int [SomeProgramVariable];
for (inti=0;i{
*(pNumber+i) = i;
}
...
...
delete [] pNumber;
I want to return the pNumber, so that another function can use this pointer.....for example, I can call this function liked...... GetPointer(pNumber)....and when the function calls this, it can get pNumber from the parameter.........
But I cannot get the information i want.....
how to do it???
|
|
|
|
|
First of all, do not delete it!
However, you have to store the pointer somewhere, in a global variable or, better, in a member variable if you're using classes.
Then provide whichever method you prefer to access the pointer. If it's global or public memeber you don't need an access function, otherwise provide one.
Hope this helps,
Paolo.
|
|
|
|
|
You should no delete it!
If you need it as return value, declare:
int *GetPointer()
{
int *pNumber = new int [SomeProgramVariable];
...
return pNumber;
}
If you need it as parameter, pointer to pointer is necesary because you are allocate memory on function body:
void GetPointer(int **pNumber)
{
*pNumber = new int [SomeProgramVariable];
...
}
|
|
|
|
|
>>void GetPointer(int **pNumber)
>>{
>> *pNumber = new int [SomeProgramVariable];
>> ...
>>}
"pointer to pointer" is just plain silly - in C++ it should almost always be reference to pointer :
void GetPointer(int *&pNumber)
{
pNumber = new int [SomeProgramVariable];
...
}
With "pointer to pointer" the following code compiles but crashes
GetPointer(NULL);
With "reference to pointer" it would never compile.
|
|
|
|
|
Ok. That's good. It's an alternate form.
No necesary it's plain silly!
Remember, good programers don't trust only on compiler. You should verify every part of code. And, if you look COM interfaces, 'pointer to pointer' is essential.
Oscar L.
|
|
|
|
|
This may be a dumb question, but I'm having trouble getting the CIPAddressCtrl in my application. When I place a IP Address Control on the dialog in the resource editor I can't start my app. The Run function fails to create my main Dialog when the app starts. If I try and manually create a CIPAssressCtrl in my OnInitDialog the create method return 0 every time. Anybody got some examples that I could look at?
Timothy Bish
|
|
|
|
|
the appwizard generated _tWinMain() looks like this
INITCOMMONCONTROLSEX iccx;
iccx.dwSize = sizeof(iccx);
iccx.dwICC = ICC_COOL_CLASSES | ICC_BAR_CLASSES;
BOOL bRet = ::InitCommonControlsEx(&iccx);
you need to add ICC_INTERNET_CLASSES to the dwICC member.
|
|
|
|
|
I have created a Registry Backup program that restores and saves certain registry files. However, it only works fine when logged on as an administrator. When logged on with less rights I have the following error:
1314 : A required privilege is not held by the client.
I know from previous investigations that privileges need to be set which I have done as follows:-
BOOL CRegistryBackupDlg::EnableBackupPrivilege()
{
HANDLE hToken = NULL;
if(!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
return FALSE;
TOKEN_PRIVILEGES tkp;
LookupPrivilegeValue(NULL, SE_BACKUP_NAME, &tkp.Privileges[0].Luid);
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
BOOL bOk = AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, NULL, 0);
CloseHandle(hToken);
return bOk;
}
and
BOOL CRegistryBackupDlg::EnableRestorePrivilege()
{
HANDLE hToken = NULL;
if(!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
return FALSE;
TOKEN_PRIVILEGES tkp;
LookupPrivilegeValue(NULL, SE_RESTORE_NAME, &tkp.Privileges[0].Luid);
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
BOOL bOk = AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, NULL, 0);
CloseHandle(hToken);
return bOk;
}
These usually allow to perform the functions. However I have pinpointed my problems down to RegSaveKey and RegRestoreKey not having sufficient privileges when not logged on as administrator.
My two regsitry calls look like this :-
lResult = RegSaveKey(hKey, m_current_path , NULL);
or
lResult = RegRestoreKey(hKey, m_current_path, NULL);
Like I said it usually works when logged on as administrator so I know that the majority of my code works it just a slight tweak of the privileges that is required but I really don't what is needed. Can you help?
Thanks in advance.
|
|
|
|
|
The RegSaveKey() and RegRestoreKey() docs say you need the SE_RESTORE_NAME priv, not SE_BACKUP_NAME. Try changing that.
--Mike--
http://home.inreach.com/mdunn/
"Holding the away team at bay with a non-functioning phaser was an act of unmitigated gall. I admire gall."
-- Lt. Cmdr. Worf
|
|
|
|
|
I have already set these privileges it appears to be more involved than that.
|
|
|
|
|
I need to make my own control that should be a rather complicated list box. But where do I start? Is there any good tutorials for this on the net or books?
Should I inherit from CWnd or CListCtrl? Stuff like that, that I need answers to.
Cheers
|
|
|
|
|
Here is a good place to start
http://www.codeproject.com/combobox/
|
|
|
|
|
Hi,
I have a dialog with a static text control. I want to change it's caption at run time. Despite it having an ID in the .rc file (IDC_STATIC), it doesn't come up in classwizard so i can't map it to a CStatic object and thus use the inherited CWnd::SetWindowText member function to update it's text.
I tried manually adding the mapping with :
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMonemupdDlg)
DDX_Control(pDX, IDCLOSE, m_Close);
DDX_Control(pDX, IDC_STATIC, m_Static);
//}}AFX_DATA_MAP
and defining CStatic m_Static in the header file, in the same place as the ClassWizard created definition for IDCLOSE/m_Close. But although this compiles, I get a debug assertation failure in dlgdata.cpp at line 37.
What am I doing wrong?
I know that I could just use CStatic::Create to create the static text control but i'd far rather have the resource managed in the dialog editor.
Thanks for your help
Jon
|
|
|
|
|
IDC_STATIC is a special identifier: has a value of -1 and it's used to mark controls that are not accessed at runtime. Change it to something else, like IDC_TXT1, and you'll see it in the class wizard.
Anyway, if you just want to change the text in response to some event (e.g. button being pushed), you can always use this:
GetDlgItem(IDC_TXT1)->SetWindowText("new text");
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
ok in my application i have this error message when i try to build my project:
"C:\program files\microsoft visual studio\vc98\mfc\include\afxv_32.h(14): fatal error C1189: #error : WINDOWS.H already included. MFC apps must mot "include <windows.h>
my application is created with mfc appwizard exe, and i have choosen the dialog based option.
So, in my dialog box i have put an button which must access an excel database with ADO method.
so....? idon't know what is happening.
gerald
|
|
|
|
|
Check stdafx.h. Probably you have #include <windows.h> before afxwin.h.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi,
I like to know how can I get a pointer to the previous document template?
Basically have access to the data of precious document.
Thank
Ehsan Behboudi
|
|
|
|
|
previous document or previous document template? the twoa re very different creatures
if you need a particular doc template you can iterate thru the list using CApp::GetFirstDocTemplate() and CApp::GetNextDocTemplate()
if you need the previous document you can iterate through the list of docs of that type by using pTemplate->GetFirstDocPosition() and pTemplate->GetNextDocPosition() (where pTemplate is a pointer to the doc template for those doc types)
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Hello!
Does anyone know how can we insert two string tables in a dialog based application. And how to load data from each string table.
The string id's in both string tables can be same.
I need it urgent.
|
|
|
|
|
Why do you need two strings with same identifiers? Is this a multi-language app?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Yes it is a multi-language application.
Can u help me plz..
|
|
|
|