|
line #5 needs a semi-colon at the end.
|
|
|
|
|
There's several things wrong.
1/ You didn't read the posting guidelines, and put your code in pre tags, so there's no way on earth that I can be bothered to work may way through that wall of code.
2/ 1st error, as you've seen is a missing semi colon.
3/ 3rd error... When putting in tot prototype for your multiply function, you don;t say what kind of things a and m are. ints? doubles? struct Froobles?
OK, done now.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hello Team ;
I have a library file (.LIB) with Password protect it. I'm looking for a recovery software or application or anyway to recover the password.
Any thought....
Please reply...
Thanks for all of your help.
|
|
|
|
|
Password? A LIB file? Naaaaa. Unless you mean a LIB file that isn't an object library.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
That is correct. I do have a.Lib file and it is password protected. We would like to recover the password. so we can view the Lib ...
|
|
|
|
|
It's still doesn't make any sense...
As Stuart pointed out, a .lib file is not password protected. So, if you really want some help, I suggest you try to explain your problem in a much better way.
By the way, does it have anything to do with C++ ?
|
|
|
|
|
Its probably done by some package that encrypts the file and decrypts it on giving the right password.
I remember writing one during the old DOS days.
Now, will that work here...
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
DallasProgrammer wrote: I do have a.Lib file and it is password protected.
By what?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
(oh please say "a license key"! oh please oh please oh please)
|
|
|
|
|
Are the functions inside the lib file protected at runtime ? i.e. do they need a license to run?
This signature was proudly tested on animals.
|
|
|
|
|
Hi,
Am getting to grips with the g++ compiler...
I have my main cpp file containing the main function in
/home/alfred/Public/Test/
I have my header file in
/home/alfred/Public/Test/header/
I have my src file for the header in
/home/alfred/Public/Test/src/
I used the command
g++ -c -Wall -I/home/alfred/Public/Test/header/ myclass.cpp
to generate my myclass.o object file and then the archiver to create the library
ar rc mylib.a myclass.o
which was fine but now I am having problems compiling and linking the main.cpp file to get my exe. I am trying to use the command
g++ -L/home/alfred/Public/Test/src -I/home/alfred/Public/Test/header/ main.cpp -o a.out
but I am being returned the error
/tmp/ccmZLiDt.o: In function `main':
main.cpp text+0x59): undefined reference to `myclass::myclass(int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
collect2: ld returned 1 exit status
meaning that it cannot see the constructor for the class myclass. I thought the -L flag is to tell it where your library is which has the constructor definition? Ummm, am I getting confused with the -l flag?
Thanks for any information.
|
|
|
|
|
You still need to tell the linker which library to use. You can:
- Add mylib.a to the list of inputs (note that a.out is the default output name from the linker):
g++ -L/home/alfred/Public/Test/src -I/home/alfred/Public/Test/header/ main.cpp -o a.out mylib.a - You can rename the library so it starts with 'lib' - e.g. libmylib.a and then use the -l option by removing the 'lib' prefix:
g++ -L/home/alfred/Public/Test/src -I/home/alfred/Public/Test/header/ -lmylib main.cpp -o a.out
The -L option tells the linker what directory to look in for library files. The -l option tells the linker which library files to use.
HTH!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hey ya,
Many thanks for your tips, I tried both but unfortunately I got errors....
For the command line
g++ -L/home/alfred/Public/Test/src -I/home/alfred/Public/Test/header/ main.cpp -o a.out mylib.a
I got the error
g++: mylib.a: No such file or directory
and for the command line
g++ -L/home/alfred/Public/Test/src/ -I/home/alfred/Public/Test/header/ main.cpp -lmylib.a -o a.out
I got
/usr/bin/ld: cannot find -lmylib.a
collect2: ld returned 1 exit status
even though I have libmylib.a (where the -l substitututes the lib part).
Ummm, any ideas? Seems it still can't "see" the mylib.a
Many thanks!
|
|
|
|
|
minkowski wrote: For the command line
g++ -L/home/alfred/Public/Test/src -I/home/alfred/Public/Test/header/ main.cpp -o a.out mylib.a
I got the error
g++: mylib.a: No such file or directory
Sorry - for that one, you need the path to the lib on the command-line, not just the name
minkowski wrote: for the command line
g++ -L/home/alfred/Public/Test/src/ -I/home/alfred/Public/Test/header/ main.cpp -lmylib.a -o a.out
I got
/usr/bin/ld: cannot find -lmylib.a
collect2: ld returned 1 exit status
even though I have libmylib.a (where the -l substitututes the lib part).
Again - sorry, I forgot to say that you don't need the '.a' part either
HTH!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi ya,
Thanks for your reply. The folllowing worked....
g++ -L/home/mpotter/Public/Test/src/mylib.a -I/home/mpotter/Public/Test/header/ main.cpp -o a.out /home/mpotter/Public/Test/src/mylib.a
as opposed to
g++ -L/home/mpotter/Public/Test/src/ -I/home/mpotter/Public/Test/header/ main.cpp -o a.out mylib.a
which did not. also
g++ -I/home/mpotter/Public/Test/header/ main.cpp -o a.out /home/mpotter/Public/Test/src/mylib.a
works, so I am afraid I don't see the point of using the -L flag to give the location? you can just put the path on the end to your library and it will work fine.
I got the
g++ -L/home/mpotter/Public/Test/src/ -I/home/mpotter/Public/Test/header/ main.cpp -lmylib -o a.out
to work fine. This one with the -l flag makes sense as you use the -L to give the location and -l to give the library name. But the one with just the -L flag (the 1st case) does not make sense to me.... Can you pls explain?
Thanks !
|
|
|
|
|
The -L option is only relevant if you use -l to specify the library name. The g++ documentation[^] says:
<blokquote>-Ldir
Add directory dir to the list of directories to be searched for -l.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
hey ya
Thanks for that. I can see now why it didn't work for the initial -L case. I thought the -L and -l were independent but apparently not !
|
|
|
|
|
Using MFC Dialog App with VC6
I need some help to force redraw of buttons?
I have a bitmap image displayed in my dialog using the picture control and have positioned over the top of it number of CButton's (ie the buttons overlap the image). I want to get the buttons to remain displayed when I change the bitmap image in the button selected function.
If I have an "OnSel" function for each button with code like this :
void CDesignEditDlg::OnButtonSel3() <br />
{<br />
MessageBox("Button 3 Pressed", "Select", MB_OK) ;<br />
<br />
}
When I run the app and press a button it is all fine, ie I get the button pressed message pops up and all the buttons are still shown.
Since I want to change the image displayed while the button is pressed I tried to modify my code to something like this.
void CDesignEditDlg::OnButtonSel2() <br />
{<br />
m_ctrlPageImage.SetBitmap(cBmp[1]);<br />
<br />
MessageBox("Button 2 Pressed", "Select", MB_OK) ;<br />
<br />
m_ctrlPageImage.SetBitmap(cBmp[0]);<br />
}
This works in that it changes the displayed image while the popup message is on screen but all the buttons other than the one I pressed have disappeared.
Is there a way to force MFC to redraw my buttons over the top of the image after I have changed it ??
|
|
|
|
|
Try adding the WS_CLIPSIBLINGS[^] style to your picture control, maybe add WS_CLIPCHILDREN to the dialog itself. If all that doesn't help, try using RedrawWindow[^] on your buttons.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Could'nt find WS_CLIPSIBLINGS as property to my Picture Control ! I tired setting WS_CLIPCHILDREN in the dialog, it had no effect.
RedrawWindow seems to be "half" working in that it is redrawing the buttons before my pop dialog displays. But after exiting the popup and reverting the image to the orignal bitmap the button redraw does not have any effect. ie After finishing the ButtonPressed func all the buttons have dissappeared again except the one I pressed.
Any more thoughts ?
My code is now like this in the button selection.
void CDesignEditDlg::ButtonPressed(int btn)<br />
{<br />
m_ctrlPageImage.SetBitmap(cBmp[1]);<br />
<br />
CButton* pImage ;<br />
int b ;<br />
for(b = 0 ; cButPos[b].id > 0 ; b++) {<br />
pImage = (CButton*)GetDlgItem(cButPos[b].id);<br />
pImage->RedrawWindow() ;<br />
}<br />
<br />
CColourFaderDlg dlg;<br />
int nResponse = dlg.DoModal();<br />
if (nResponse == IDOK)<br />
{<br />
}<br />
else if (nResponse == IDCANCEL)<br />
{<br />
}<br />
<br />
for(b = 0 ; cButPos[b].id > 0 ; b++) {<br />
pImage = (CButton*)GetDlgItem(cButPos[b].id);<br />
pImage->RedrawWindow() ;
}<br />
<br />
m_ctrlPageImage.SetBitmap(cBmp[1]);<br />
}
|
|
|
|
|
Ignore pervious message, I goofed !!
I had the redraw of the buttons before changing the bitmap instead of after.
|
|
|
|
|
Use ModifyStyle[^] to add the WS_CLIPSIBLINGS style (piccontrol.ModifyStyle(0, WS_CLIPSIBLINGS); ). If that still doesn't work, do the redrawing of the windows after you call SetBitmap on your picture control, not before it. Btw if i were you i would go another way with this, having overlapped controls on a dialog is imho nothing but trouble.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Neil Urquhart wrote: I have a bitmap image displayed in my dialog using the picture control and have positioned over the top of it number of CButton's (ie the buttons overlap the image). I want to get the buttons to remain displayed when I change the bitmap image in the button selected function.
Hi! I suggest to make the buttons child controls of the image. They have to be child controls, because overlapping siblings are poorly supported by Windows (see KB79981). Yes the MSDN article is one of the worst I have ever read and left me also confused the first time I read it. Even if you would manage to make overlapping controls work somehow else (e.g. by using transparency), you will sooner or later see redraw artefacts such as parts not been redrawn correctly.
Create your buttons as child controls from the start or use SetParent() in CDesignEditDlg::OnInitDialog() .
Let me know if this works for you.
/M
[Edit: Fixed name of message handler and added some swearing]
modified on Tuesday, September 15, 2009 8:32 PM
|
|
|
|
|
I tried using SetParent on all the buttons as below but now I don't see any buttons anywhere ! Did I miss something ? Do I need to set some extra things ?
BOOL CDesignEditDlg::OnInitDialog() <br />
{<br />
CDialog::OnInitDialog();<br />
<br />
<br />
CWnd* pImage ;<br />
WINDOWPLACEMENT wpImage ;<br />
CRect rect;<br />
CPoint imgPos ;<br />
<br />
pImage = GetDlgItem(IDC_PAGEIMAGE) ;<br />
pImage->GetWindowPlacement(&wpImage);<br />
imgPos.x = wpImage.rcNormalPosition.left ;<br />
imgPos.y = wpImage.rcNormalPosition.top ;<br />
<br />
<br />
int b ;<br />
for(b = 0 ; cButPos[b].id > 0 ; b++) {<br />
pImage = GetDlgItem(cButPos[b].id);<br />
pImage->GetWindowRect(rect);<br />
pImage->MoveWindow(imgPos.x + cButPos[b].x, imgPos.y + cButPos[b].y, rect.Width(), rect.Height(), TRUE);<br />
<br />
pImage->SetParent(this) ;<br />
}<br />
<br />
<br />
cBmp[0].LoadBitmap(IDB_IMAGE0);
cBmp[1].LoadBitmap(IDB_IMAGE1);<br />
<br />
<br />
return TRUE;
}
|
|
|
|
|
Ah ha !
Got it sussed. I should have used SetParent on the picture control and all its overlaping buttons to make them all children of the CDialog. I had to set the WS_CLIPCHILDREN/WS_CLIPSIBLINGS for the dialog/picture control to make it work. Without setting these properties the buttons don't display.
My code now looks like this with no "button redraw's" in the buttons select function.
BOOL CDesignEditDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CWnd* pImage ;
WINDOWPLACEMENT wpImage ;
CRect rect;
CPoint imgPos ;
ModifyStyle(0, WS_CLIPCHILDREN) ;
pImage = GetDlgItem(IDC_PAGEIMAGE) ;
pImage->GetWindowPlacement(&wpImage);
imgPos.x = wpImage.rcNormalPosition.left ;
imgPos.y = wpImage.rcNormalPosition.top ;
pImage->ModifyStyle(0, WS_CLIPSIBLINGS);
pImage->SetParent(this) ;
CWnd* pButton ;
int b ;
for(b = 0 ; cButPos[b].id > 0 ; b++) {
pButton = GetDlgItem(cButPos[b].id);
pButton->GetWindowRect(rect);
pButton->MoveWindow(imgPos.x + cButPos[b].x - (rect.Width()/2), imgPos.y + cButPos[b].y, rect.Width(), rect.Height(), TRUE);
pButton->SetParent(this) ;
}
cBmp[0].LoadBitmap(IDB_IMAGE0);
cBmp[1].LoadBitmap(IDB_IMAGE1);
return TRUE;
}
void CDesignEditDlg::ButtonPressed(int btn)
{
m_ctrlPageImage.SetBitmap(cBmp[1]);
CColourFaderDlg dlg;
dlg.iFaderLineNo = btn ;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
}
else if (nResponse == IDCANCEL)
{
}
m_ctrlPageImage.SetBitmap(cBmp[0]);
}
void CDesignEditDlg::OnButtonSel1()
{
TRACE("Button 1\n") ;
ButtonPressed(1) ;
}
|
|
|
|