|
Now,
palbano wrote:
1) maybe not. certainly not safe
I'm assuming that the reason is when you rebuild the dll using the new header, regardless of what you have added (even if it was only a #define 5), there's no garauntee that the Function pointer map will be the same as when the exe was built against the dll. Am I right in this assumption? Becuase this is how I understood dlls to work if you link them statically.
palbano wrote:
2) yes
Dynamic linking on the other is void of this possible issue becuase you are getting the function pointer at run time. Am I correct in this assumption?
Again thanks! I look forward to hearing your input.
Dan Willis
|
|
|
|
|
>> that has additions to it's .h including new exported funcions
actually i was refering to that statement from your first post. Also if you use a DEF file you can order the functions so that could reduce the risk.
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
Right. That makes sense. Thanks alot! I really appreciate it. Learn something new everyday!
Dan Willis
|
|
|
|
|
Hi everybody!!!
Explain in what a difference of the next lines of a code on Win95:
1.
CRgn m_rgn1;
CRgn m_rgn2;
{
m_rgn1.DeleteObject();
m_rgn2.DeleteObject();
CRgn rgn;
rgn.CreateRectRgn (0, 0, 1, 1);
...
rgn.CopyRgn(*m_rgnToolTip);
...
rgn.CombineRgn (*rgn, *m_rgn2, RGN_OR);
SetWindowRgn (HRGN(rgn), FALSE);
rgn.DeleteObject ();
}
2.
CRgn m_rgn1;
CRgn m_rgn2;
{
m_rgn1.DeleteObject();
m_rgn2.DeleteObject();
CRgn rgn;
rgn.CreateRectRgn (0, 0, 1, 1);
...
rgn.CopyRgn(*m_rgnToolTip);
...
rgn.CombineRgn (*rgn, *m_rgn2, RGN_OR);
HRGN hRgn = CreateRectRgn(0, 0, 1, 1);
::CombineRgn(hRgn, (HRGN)rgn.GetSafeHandle(), NULL, RGN_COPY);
SetWindowRgn(hRgn, FALSE);
rgn.DeleteObject ();
}
Why on Win95 the first variant was fail
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Came across the following:
typedef double (*COMPLEX_ARRAY)[2];
What does this do??
Thanks for any help you might give me,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
pankajdaga wrote:
What does this do??
Confuse people, that's probably its main objective.
It's actually just a declaration for a pointer-to-a-two-dimensional-array-of-doubles-where-the-second-dimension-must-be-2.
So you can do this:
COMPLEX_ARRAY ca = NULL;
ca = new double[10][2];
delete [] ca;
double xyz[5][2];
ca = xyz;
ca[0][0] = 4.6;
ca[0][1] = 20.67;
Regards,
Alvaro
The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing. -- Albert Einstein
|
|
|
|
|
Ahhhhhh... I see. I knew it was like that. The syntax just confused the hell out of me. Thanks for the explanation! I wonder why people code like that!
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Multi-dimensional arrays in C/C++ make C strings look like the greatest thing since sliced bread.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hi. Im thinking of using crystal reports in my companys applications but im not sure how the licensing works.
The main question is: if i dont require the clients aplication to have a report designer, only print preview, printing and exporting, which license must i purchase?
I dont think i need the "Crystal Reports 9 Report Creation API Named User License, English", cause it includes the designer "...in order to integrate end user report creation capabilities into thick-client desktop applications.".
But i havent found another licensing program for my case.
Anyone with experience in this can help me?
|
|
|
|
|
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
|
|
|
|