|
Miguel Lopes wrote:
Anyone with experience in this can help me?
When I used Crystal 8.5 we had to make sure that we had a license for each client even though all they were doing was viewing the report (ad-hoc). We looked into using them for reporting over the web; however we decided to go with Data Dynamics because they have a royalty-free report designer. Besides, Crystal Reports over the web is way too expense, call them and they will quote you a price.
Nick Parker
The only man who never makes a mistake is the man who never does anything. - Theodore Roosevelt
|
|
|
|
|
Hi. Thanks for the quick answer.
I started looking at Data Dynamics for their "Active Reports" products, but it seems it only works with VB! Im a VC++ programmer and im in a middle of a vc++ software development, so vb is not an option.
On the other hand, it has an activeX version... can i access it easely through vc++?
|
|
|
|
|
Miguel Lopes wrote:
On the other hand, it has an activeX version... can i access it easely through vc++?
With version 8.5 you most certainly can, you used to be able to download a free trial version which actually came with samples in the different languages, I remember it had samples for both VB and VC++. Check them out, they really have a nice product, but so does Crystal. I think it really depends on how much you are willing to pay. I haven't found anything that I couldn't do with Active Reports that I could with Crystal.
-Nick
|
|
|
|
|
You were right! Active Reports is really an excellent product! Ive read most of their documentation and it fits really well! Now im stuck cause i dont find VC++ samples and especially cause i dont know how can i get the required DLL's to make a test application so we can decide to buy it or not.
Can u give me some links or hints?
Thanks for the help in general!
|
|
|
|
|
Miguel Lopes wrote:
Can u give me some links or hints?
Try Product Downloads[^], select ActiveReports 2.0 Pro unless you need to get the .NET version. I believe that it comes packed with samples. Let me know.
-Nick Parker
|
|
|
|
|
Thanks for the quick answer! Since my last msg, i already started to use the product downloads and right now i already have a vc++ working app with the activeX. Now i only need to learn the API
Thanks for the help! Now im on track. Ill have it incorporated in our apps within a week!
|
|
|
|
|
Glad to help.
-Nick Parker
|
|
|
|
|
I have a window which contains a bunch of checkboxes and buttons. They need to be created dynamically based on the output of a parsed configuration file. The controls will, after creation, have their font set to DEFAULT_GUI_FONT. Given that the labels in the controls are arbitrary, I need a way to determine the necessary size of the buttons. It must be pretty close to minimum size to give proper visual layout: it would be bad aesthetics to leave a bunch of excess margin on the right to account for potentially longer labels than anticipated. Same goes for the height, I don't want excess margin between the buttons. Keeping the right and between margins to a minimum will minimize the wasted screen real estate as well, which is fairly critical for this application. So how does one determine the necessary size? I could just get the text extents from the font, but then I'd have to hardcode the added sizes like the label-to-frame margin within the buttons and size of the non-label portion of a checkbox, but that seems kludgy. Is there an API to, after setting the font of a control, tell it to resize itself to the proper minimum dimensions? I can't find one but hope it's buried in there somewhere....
Thanks in advance,
Brian Tietz
|
|
|
|
|
I think you have to do it the hard way... and it doesnt seem so difficult...
May the SOURCE be with you
|
|
|
|
|
By "the hard way" do you mean kludging in extra pixels relative to the text extents?
|
|
|
|
|
Yes, and it doesnt sound so devlish as you put it. Remember that engineering is not allways a precise field, and sometimes all a gadget needs is a small kick or slap "adjustment". And even if you found that API, it would probably do it this way.
|
|
|
|
|
I have an application with a system wide hook in a DLL. I hook on WH_SHELL, and within the hook process a message is sent back to the application. I do the following:
Inside DLL
const UINT wm_Snd =RegisterWindowMessage( "TEST_MSG" ); //global variable
inside the hook routine:
PostMessage(HWND_BROADCAST,wm_InternetCheck,0,0);
Now inside my CMainframe application:
header:
afx_msg LRESULT OnTest(WPARAM wParam, LPARAM lParam);
source code:
const UINT mw_Snd = RegisterWindowMessage( "TEST_MSG" );//global variable
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
//{{AFX_MSG(CMainFrame)
//}}AFX_MSG
ON_REGISTERED_MESSAGE(mw_Snd ,OnTest)
DECLARE_MESSAGE_MAP()
}
LRESULT CMainFrame::OnTest(WPARAM wParam, LPARAM lParam)
{
AfxMessageBox("Called..");
return 0;
}
Now in debug mode, It works no problem. But In Release mode, the message doesnt get to the application. It gets posted okay from the DLL, but the
AfxMessageBox("Called.."); Never gets called.
Neil
|
|
|
|
|
I have made a program using MFC wizard to make a dialog box. I need to add a "Browse" button through which the user can select one file or folder, and get the filename and path (relative to the program's folder, assuming that the file or folder is in it, or the full path if outside the program's folder). I then want to put that name and path into an edit box in 8.3 filename format. Is there a simple way to do such a thing?
Thank you very much for your time and effort.
<marquee>Hosam Aly Mahmoud
|
|
|
|
|
Yes. One solution is CFileDialog.
Kuphryn
|
|
|
|
|
I think you should take a look at the CFileDialog class in the MSDN for using the "open file" common dialog.
CFileDialog
The paths retreived from the CFileDialog s are all absolute path, so you need to change it to relative paths yourself.
I did not try to get folder paths using this common dialog but you may use the "Browse For Folder" dialog that can be used through the SHBrowseForFolder() shell function. Again you will find it in the MSDN.
SHBrowseForFolder()
This function could be a little complicated to use but I think there are some wrapper classes on code project for it.
For the last part cocerning the 8.3 paths there is the API function GetShortPathName( ) for doing this and here is its parameters.
DWORD GetShortPathName(
LPCTSTR lpszLongPath,
LPTSTR lpszShortPath,
DWORD cchBuffer
);
|
|
|
|
|
Thank you very much for your help.
1. I couldn't understand how the shell function SHBrowseForFolder() works. Could you please tell me either how to use it or how to avoid it?
2. Is there a way to find the path of the program? This way I could remove it from the path to get a relative one.
3. How can I use an API function inside my MFC application?
Thank you again.
<marquee>Hosam Aly Mahmoud
|
|
|
|
|
1. As i told you in my post you could find a wrapper class for the SHBrowseForFolder( ) on code project this is its link http://www.codeproject.com/shell/cxsbrowsefolder.asp
2. The best way to get the program path exactly is to use the function GetModuleFileName() this is its declaration:
DWORD GetModuleFileName(<br />
HMODULE hModule,
LPTSTR lpFilename,
DWORD nSize
);
This function gives you the whole path to your program including the file name. Just remove the file name and you get theabsolute path of the program.
This is an example of how to use it to get the program path:
TCHAR procPath[MAX_PATH];
GetModuleFileName(hInst, procPath, MAX_PATH * sizeof(TCHAR));
CString strPath = procPath;
strPath = strPath.Left(str.ReverseFind('\\'));
But in some cases this is not the working path of the program (i.e. the working path is the path assumed if you just gave the program a file name only). One of this case is if you tried to double click a document to be opened with your program , in this case the working path will be that of the document. Any way to get the working path you may use the funcion GetCurrentDirectory()
DWORD GetCurrentDirectory(<br />
DWORD nBufferLength,
LPTSTR lpBuffer
);
it returns the current working directory of the program. See which one suits your situation and use it.
3. MFC are wrappers for the API functoins, you can call API functions anywhere in your MFC project as any other function, but in some cases an MFC method could have the same name as an API in this case you should preceed the function call with a double scope.
e.g. the method SetWindowText() if you want to call the API SetWindowText() instead of it call it like that
::SetWindowText()
|
|
|
|
|
Thank you very much for your appreciated help.
Now I want to remove the path from the filename I got from the Browse button. I shall tell you of a way I tried to use (before I read your second reply).
I used system ( "cd >> dir" ) to get the program's path, read it in a buffer and then compared it to the first characters in the filename. To take out the path, here is the code I used:
for (short i = 0; i < length; i ++)
if ( FileName.GetAt(i) != path.GetAt(i) ) { i=-1; break; }
if (i == -1) break;
for (short j = 0; i <= FileName.GetLength(); i ++, j++)
FileName.SetAt (j, FileName.GetAt(i) );
This part of code was inside a loop, and length is the length of the path of the program. FileName is the buffer in which I stored the filename from the browse button. The problem with the above code is that it doesn't work when the program is at the root folder of a partition. What do you think is the reason?
I am thinking of using a similar code (with GetModuleFileName instead of system ( "cd >> dir" ) . But shouldn't this give me the same problem?
If you find that my method was faulty somehow, please tell me.
Again thank you for your help.
<marquee>Hosam Aly Mahmoud
|
|
|
|
|
Let's say I have a some user mode C code, and I want to execute some privilged instruction, like wrmsr.
I write a function in user mode called mywrmsr( ARGS args ); with a bunch of instructions that can't be executed in user mode.
Then I send the address of this function (and the args) to a kernel driver with an IOCTL.
The kernel driver executes the code given by the function *.
Will this work???
Jeff Yunes
Georgia Institute of Technology
Intel Corporation
|
|
|
|
|
I am trying to compile a file that includes stl.h
I get fatal error C1083: cannot not open include file 'stl.h': No such file ....
How do I use stl in Visual C++?
|
|
|
|
|
You need to include each one individually, for example, for vectors, you need to include
#include <vector>
There also might be a global include for all STL headers.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Also, if you don't put:
using namespace std;
You will have to explicitly specify the STL:
std::vector<int> MyInts;
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Is there a way to retrieve the access token (either primary or impersonated) of the user currently logged-on to the console? I need this so I can execute a process in that user's security context from an NT Service running in the System context.
Any suggestions?
|
|
|
|
|
|
Alrighty, that did point out a few functions i could use. Thanks However, my problem still remains. If i'm currently running as a service (in the SYSTEM context), how can i find out (a) if there is a user logged on to the console, and (b) who they are so i can spawn a process running under their context?
I've been searching high and low for information on this, and all i've found so far is that I must be running as that user in order to get information about them. There must be a way to find this information, though.
My specific application is this: If my service wants to spawn an instance of IE and the currently logged-on user has a proxy setting, the instance of IE that gets opened by my service has no knowledge of that proxy setting since its running unser the SYSTEM account, and not that specific user's account.
I had thought about trying to enumerate all the logged-in users and finding out if one of them is logged on locally...that would do it, i believe. But I haven't found a way to do that. There was also mention of creating a GINA to trap the username of who logged on, but i have a feeling this wouldn't work for my application.
|
|
|
|