|
I am trying to link a static lib (*.lib) build on C compiler through nmake. It give me some funny errors duing linkage time.
Do I need to call extern "C" for each of the function that I need to use?
Or any remedies or reference for this.
thank you.
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
problem has been solved. It appears to be a file version problem.
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
Anthony_Yio wrote:
I am trying to link a static lib (*.lib) build on C compiler through nmake. It give me some funny errors duing linkage time.
What where the errors?
Michael
CP Blog [^]
|
|
|
|
|
Sorry friend, it appear to be a file version problem of mine.
Thanks you anyway.
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
Thanx.
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
How about monitoring clipboard?
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
Tried that but you get events only when someone is trying to put some data into the clipboard and not when someone is reading it.
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
How about
WM_DRAWCLIPBOARD
handler?
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
And hope that all windows preceeding the one with the handler passes the message on.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
If you've done API hooking before, hook the OpenClipboard(), SetClipboardData()
Search goole for "apispy32"
Bikram Singh
|
|
|
|
|
Hi Dear...
I struck in a problem & I know you can help me..
I've a pro-merchant account in amazon..& I want to upload Inventory to amazon.. but getting problem..File Error..even from site upload...
Can you send me Execl file you used for that uploading...
+ if possible some coding snippet of uploading invenorty. I want to upload through coding.. send me at:
sumit_kapoor1980@hotmail.com
or chat with me at hotmail account or yahoo: sumit_kapoor1980@yahoo.com
I hope you will help me..
Thanks
Have a Nice Life..
Sumit Kapoor.
---Sumit Kapoor---
|
|
|
|
|
plz can any one help me in deleting a Text file thru c or c++ vc++ program..
( i am using "ShellExecute(NULL, "del","c:\\res.txt",0, 0, SW_HIDE);" but this statment is not working.)
|
|
|
|
|
1.Windows API
BOOL DeleteFile(<br />
LPCTSTR lpFileName
);
2. MFC method
static void PASCAL Remove( LPCTSTR lpszFileName );<br />
throw( CFileException );
3. Windows Shell API
SHFileOperation()
I'd prefer the first way, but the 3rd way is powerful
|
|
|
|
|
I'm trying to draw a stetched image, but only the part that need updating, with the following code:
if (IntersectRect(&rcIntersected, &ps.rcPaint, &rcImgScrolled))
{
float rx = (float)ImgWidth / (float)ZoomedImgWidth;
float ry = (float)ImgHeight / (float)ZoomedImgHeight;
int dl = rcIntersected.left - ps.rcPaint.left;
int dt = rcIntersected.top - ps.rcPaint.top;
int dw = RECTWIDTH(rcIntersected);
int dh = RECTHEIGHT(rcIntersected);
int sl = int(float(rcIntersected.left - rcImgScrolled.left)*rx);
int st = int(float(rcIntersected.top - rcImgScrolled.top)*ry);
int sw = int(float(RECTWIDTH(rcIntersected))*rx);
int sh = int(float(RECTHEIGHT(rcIntersected))*ry);
StretchBlt(hDCBuffer,
dl, dt, dw, dh,
hDCCurImg,
sl, st, sw, sh,
SRCCOPY);
}
The problem is when the window is at certain sizes (the zoom is scaled to the window), the last row or column isn't drawn.
I know it's because of the floats being rounded off, but how do you fix so it gets the exact number of pixels needed?
I tried floor() which had no effect, and ceil() which would sometimes draw an extra row or column of random colors...
-thanks
|
|
|
|
|
did someone have this problem the other day?
my app hangs quite often when i try to debug
any suggestions?
|
|
|
|
|
hi,
i want to know any method i can use Visual Studio .NET to build application with old mfc class. so that i dont need to ship the mfc71.dll?
actually, i can build my convert and build old application in visual studio .net. however, it link to mfc71.dll. i dont want this. any help?
Thanks!
jim
|
|
|
|
|
Nope, I very much doubt there is any chance you can do this. You can install VC6 next to VC7 though.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
zecodela wrote:
want to know any method i can use Visual Studio .NET to build application with old mfc class. so that i dont need to ship the mfc71.dll?
actually,
If you use static linking to MFC rather than dynamic linking, then you won't need to ship with any MFC dlls.
Michael
CP Blog [^]
|
|
|
|
|
Hey, got another question.
I hace a combo box and an edit box, and in the combo box, there is options for time, 10 mins, 20 mins etc etc. And when you click on them, it adds it to the edit box and keesp track of the total, remeber there are 7, so you choose 7 values and it adds it up, but if you hit the wrong value and change to the other one it adds both values to the edit box, and you can't change it back without restarting the program.
<br />
int cur = m_type2.GetCurSel ();<br />
CString text;<br />
m_type2.GetLBText (cur, text);<br />
<br />
<br />
int cur1 = m_dur2.GetCurSel ();<br />
CString text1;<br />
m_dur2.GetLBText (cur1, text1);<br />
if (text1 == "10 Minutes")<br />
{<br />
if (text == "Swimming #1" )<br />
{<br />
totalswim+=10;<br />
totalrun+=0;<br />
totalcycling+=0;<br />
totalstrength+=0;<br />
}<br />
else<br />
if (text == "Run #1" )<br />
{<br />
totalrun+=10;<br />
totalswim+=0;<br />
totalcycling+=0;<br />
totalstrength+=0;<br />
}<br />
else<br />
if (text == "Cycling #1" )<br />
{<br />
totalcycling+=10;<br />
totalrun+=0;<br />
totalswim+=0;<br />
totalstrength+=0;<br />
}<br />
else<br />
if (text == "Strength #1" )<br />
{<br />
totalcycling+=0;<br />
totalrun+=0;<br />
totalswim+=0;<br />
totalstrength+=10;<br />
}<br />
else<br />
if (text == "Stretching #1" )<br />
{<br />
totalswim+=0;<br />
totalrun+=0;<br />
totalcycling+=0;<br />
totalstrength+=0;<br />
}<br />
Hours(); <br />
}<br />
<br />
<br />
void CDEPDlg::Hours()<br />
{<br />
<br />
<br />
<br />
CString str;<br />
str.Format(TEXT("%i"),totalswim);<br />
m_swimtime.SetWindowText (str);<br />
<br />
CString str1;<br />
str1.Format(TEXT("%i"),totalrun);<br />
m_runtime.SetWindowText (str1);<br />
<br />
CString str2;<br />
str2.Format(TEXT("%i"),totalcycling);<br />
m_cyclingtime.SetWindowText (str2);<br />
<br />
CString str3;<br />
str3.Format(TEXT("%i"),totalstrength);<br />
m_strengthtime.SetWindowText (str3);<br />
<br />
}<br />
That is the code for it, if you have any ideas of how to have it to waht I need it to do, please post, becasue I am out of ideas and don't really know how else to do it.
Thanks
|
|
|
|
|
You can provide another button to undo the last operation
or a "Reset" button to start again. At least it is better
than re-starting
Due Regards
Mahendra
|
|
|
|
|
Hi,
As a side issue have you considered using SetItemData to make the code look cleaner?
e.g. create enum for the Activity:
enum enumActivity
{
eSwim = 0,
eRun,
eCycle,
eStretch
};
Then when you create both combos...
CString strText;
for(int t=10; t<=60; t++)
{
strText.Format("%d Minutes");
int nIdx = m_dur2.AddString(strText);
if (nIdx >= 0) m_sur2.SetItemData(nIdx, t);
}
int nIdx2 = m_type2.AddString(_T("Swimming"));
if (nIdx2 >= 0) m_type2.SetItemData(nIdx2, (DWORD)eSwim);
nIdx2 = m_type2.AddString(_T("Running"));
if (nIdx2 >= 0) m_type2.SetItemData(nIdx2, (DWORD)eRun);
Then in the handler you gave the code for you can use a nice switch statement:
int cur1 = m_dur2.GetCurSel ();
int cur = m_type2.GetCurSel ();
switch((enumActivity)m_type2.GetItemData(cur))
{
case eSwim:
totalswim += m_dur2.GetItemData(cur1);
break;
case eRun:
totalrun += m_dur2.GetItemData(cur1);
break;
}
Hope this helps,
Andy
|
|
|
|
|
Hi guys,
I need to show my dialog always at maximised. So I use ShowWindow(SW_SHOWMAXIMIZED) . The problem is that the window that is shown will be full screen and covers the taskbar, if MAXIMIZE BOX is disabled (Resource View -> uncheck MAXIMIZE BOX)
Is there any way to show a maximised dialog with the taskbar still available when MAXIMIZE BOX is not included?
Thanks
|
|
|
|
|
<br />
OnInitDialog(){<br />
.......<br />
CRect rc;<br />
CWnd* pWnd=GetDesktopWindow();<br />
pWnd->GetWindowRect(rc);<br />
MoveWindow(0,0,rc.Width(), rc.Height(), TRUE);<br />
....<br />
}<br />
Is that all your needs?
|
|
|
|
|
Thanks for the reply,
I think you've misunderstood a bit. I want to show a maximised window that does NOT cover the taskbar area. You might want to try it yourself, have a dialog that the MAXIMIZED BOX is selected FALSE or is not ticked in the resource view. And place ShowWindow(SW_SHOWMAXIMIZED) in OnInitDialog . In my system, that creates a maximised dialog window in full screen. Try to restore the MAXIMIZED BOX, the window is then maximised, with the taskbar still showing.
I could somehow force it using
CRect deskRect;
SystemParametersInfo(SPI_GETWORKAREA, NULL, &deskRect, 0);
MoveWindow(&deskRect);
</code>
But this is not so great because the dialog is not in maxmised mode (where window borders are hidden) and also it's been fixed so if taskbar's size is later changed, the dialog window will still stay the same.
|
|
|
|
|
Try it with Border Resizing
|
|
|
|