|
|
I have the lines in my DLL.h file. I even took the Dllname.dll and put it in the Userappsource code directory. I even have the include for the header file. I guess that tells me it did find the header file to include so i put everything in the same directory as the header file as well. and in the bin directory of the User app. I just can't find the lib file that the user app is looking for.
This is what i already have in my header file.
#ifdef TESTHOOK_EXPORTS
#define TESTHOOK_API __declspec(dllexport)
#else
#define TESTHOOK_API __declspec(dllimport)
#endif
extern "C" TESTHOOK_API bool InstallHook();
extern "C" TESTHOOKHOOK_API void UninstallHook();
|
|
|
|
|
Im going to ask what could be construed as obvious ...
you do have a define for TESTHOOK_EXPORTS dont you ?
ie,
#define TESTHOOK_EXPORTS
or (from memory) /D "TESTHOOK_EXPORTS" in your project options ..
in VC6 when you're creating a dll you get a 'library' tab under project options, I wonder if its the same for whatever compiler you're using - you can define output options there
|
|
|
|
|
I am a begginer with this barely being able to crawl. So please bare with me. I am using Visual Studio 2008. when I created my project for the DLL i did chose the options for the export. short of changing the dependencies and Unicode options I haven't changed anything else.
I am way behind in what I am trying to achieve. Instead of me reposting the whole thing. Do you mind reading my question on How to get multiple handles of the same class. Superman has been helping me with a lot. and I just replied him with my problems on there too. If either of you can help I will appreciate it a lot. I am trying to solve one issue and was given two different routes tried them both and stuck with both in different ways.
If you could read that article i will appreciate all the help.
thanks for all the help. Its greatly appriciated.
|
|
|
|
|
I am building a simple quiz program and I want to implement an Stop Clock that basically starts counting from say 00:30 to 00:00. Can anyone give me some ideas or places to look for information for this implementation.
|
|
|
|
|
|
Hi guys,
I have got an urgent question which I need to solve,
Plzzz this is very urgent, my whole dissertation depends on it, can you provide guidance? Deadline is Thursday afternoon.
I have created an MFC application (dialog-based), added a Picture control to the dialog in order show images (.bmp) to the user.
Now I am trying to display the images which the user selects in a scrollable area(for which i added a CScrollView). The application works fine when I capture screenshots manually using printSc and paste them in Paint, however I want the system to automatically capture screenshots and display them. The system indeed saves the image into the hard drive but fails to show to the user.
I am getting Debug Assertion Failed!
<br />
void CDetectChangeDlg::CaptureInstantPage()<br />
{<br />
RECT rc;<br />
HWND hWnd = m_webBrowser.GetSafeHwnd();<br />
::GetWindowRect (hWnd,&rc); <br />
HDC hDC = ::GetDC(0);<br />
HDC memDC = ::CreateCompatibleDC ( hDC );<br />
HBITMAP memBM = ::CreateCompatibleBitmap ( hDC, rc.right-rc.left-20, rc.bottom-rc.top );<br />
::SelectObject ( memDC, memBM );<br />
::BitBlt( memDC, 0, 0, rc.right-rc.left-20, rc.bottom-rc.top, hDC, rc.left, rc.top , SRCCOPY );<br />
<br />
char* imageName = (char*)"InstantImage.bmp";
AnotherWayToSaveBitmap(imageName, memBM);<br />
<br />
::DeleteObject(memBM);<br />
::DeleteObject(memDC);<br />
::ReleaseDC( 0, hDC );<br />
}<br />
<br />
void CDetectChangeDlg:: AnotherWayToSaveBitmap(char *name,HBITMAP hBitMap)<br />
{<br />
CBitmap bmp;<br />
bmp.Attach(hBitMap);<br />
<br />
BITMAP bitmap;<br />
bmp.GetBitmap(&bitmap);<br />
int size = bitmap.bmWidth*bitmap.bmHeight*bitmap.bmBitsPixel/8;<br />
BYTE *lpBits = new BYTE[size];<br />
<br />
::GetBitmapBits(hBitMap,size,lpBits);<br />
WriteBmp(name,&bitmap,(int*)lpBits);<br />
delete []lpBits;<br />
}<br />
<br />
<br />
void ManualImageSegmenterDlg::DisplayImage(CString strFileName)<br />
{<br />
imageScrollView->m_Bitmap.DeleteObject();<br />
<br />
HBITMAP hBmp = (HBITMAP)LoadImage(AfxGetInstanceHandle(), strFileName, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);<br />
imageScrollView->m_Bitmap.Attach(hBmp);<br />
<br />
BITMAP bm;<br />
imageScrollView->m_Bitmap.GetBitmap(&bm);<br />
imageScrollView->m_sizeBmp = CSize(bm.bmWidth, bm.bmHeight);<br />
imageScrollView->SetScrollSizes(MM_TEXT, imageScrollView->m_sizeBmp);<br />
imageScrollView->Invalidate();<br />
}<br />
llp00na
|
|
|
|
|
llp00na wrote: Plzzz this is very urgent
You know that makes your question becoming a low-low-low priority one...
llp00na wrote: I am getting Debug Assertion Failed!
What is the asserting line? Did you give a look at the stack calls window?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I am really deseparate, my future depends on that
Assertion line is: imageScrollView->m_sizeBmp = CSize(bm.bmWidth, bm.bmHeight);
This also happens if I try to show jpgs and other formats. It could be something to do with the format of the image and the CScrollView.
No I did not, It's been a while since I programmed. So i dont know how to use the stack calls window
llp00na
|
|
|
|
|
llp00na wrote: I am really deseparate, my future depends on that
Sorry about...
llp00na wrote: Assertion line is: imageScrollView->m_sizeBmp = CSize(bm.bmWidth, bm.bmHeight);
What is exactly the assertion message?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
it is debug assertion failed
Program: ....\DetectChange.exe
File:.......\include\afxwin1.inl
Line: 221
For more info
(Press retry to debug)
So i pressed retry and got:
Unhandled exception at mfc71d.dll in DetectChange.exe:
User breakpoint
llp00na
|
|
|
|
|
The api that you're using to load the bitmap returns 0 if it failed to load. why don't you do some error checking??? (if statements)
if you're averse to that, then step through it (insert a breakpoint before you load, then run it, then press f10 and f11 to step through or step into lines, typing in variable names in the QuickWatch window to see what values are what).
|
|
|
|
|
I tried
if (hBmp != 0){
}
I still got the same error message
ANy more ideas
llp00na
|
|
|
|
|
It's OK. It would be even better if you reply to the right post.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
my bad, did it send you an email?
|
|
|
|
|
Can you send you the code to inspect please ???
llp00na
|
|
|
|
|
Heya folks.
I've been pulled into a vc6 project at the last minute. My particular task is to make a relatively large build reproducible, bit for bit, as it will be subject to auditing. The reason I was tasked with it is because I did this for another project a few years ago using MSVS 2003, but I've hit a wall with vc6.
The tl;dr version is, has anyone successfully done this with vc6? Moving to a newer tool chain isn't an option, as it's not my project.
We're building in a VM to minimize any environment differences. In the VM, we always build from the same directory, so that makes any source filenames pulled in via __FILE__ the same. As a post process, we walk the PE headers to find all of the timestamps in the file and set them to midnight, 2000-Jan-01. In the previous project, this was all that was needed. In that VM, running on any of the machines that we tested on, all builds of a particular revision would match.
Doing that with the vc6 project will work sometimes, but sometimes not. To really isolate any local differences, we have 2 machines with the same hardware using a cloned drive. Neither machine is on a network, so they don't have any collisions with each other. Because the drives are cloned, the VMs and VM executables are identical. When we put our source archive on the machine, we copy it via usb drive (same drive into the same respective usb port), unpack it, and then reboot. After rebooting, we run vc6, select our build target, and rebuild all. Running the build in this manner on these machines will sometimes produce different output. It's intermittent, but it only affects one of our 3 binary outputs. We also build a pthreads dll and shell process, and both of those always match after our timestamp fixups.
After some investigation, I'm pretty sure that the first issue (of many) is that cin, cout, and cerr (or their static constructors) are off by 3000h in the different builds. That's a huge problem, and it sounds like linker order. This project has thousands of files. Is it possible to specify their build and link orders short of a .bat file? Would that even work?
Using a binary diff of the two files, there is an area of about 1600 bytes starting at 001E41C0h (1982912) with sparse differences. Usually 1 or 2 bytes differ, then there is a string of 8-32 identical bytes. An example of the first diff, from VBinDiff, is
vm1.exe
001E 41A0: 68 80 F8 5D 00 E8 82 BD 01 00 59 C3 90 90 90 90 hÇ°].Φé╜ ..Y├ÉÉÉÉ
001E 41B0: E8 0B 00 00 00 E9 16 00 00 00 90 90 90 90 90 90 Φ....Θ.. ..ÉÉÉÉÉÉ
001E 41C0: B9 51 5C 77 00 E9 4A 10 01 00 90 90 90 90 90 90 ╣Q\w.ΘJ. ..ÉÉÉÉÉÉ
001E 41D0: 68 E0 41 5E 00 E8 52 BD 01 00 59 C3 90 90 90 90 hαA^.ΦR╜ ..Y├ÉÉÉÉ
001E 41E0: B9 51 5C 77 00 E9 A9 11 01 00 90 90 90 90 90 90 ╣Q\w.Θ⌐. ..ÉÉÉÉÉÉ
001E 41F0: E8 0B 00 00 00 E9 16 00 00 00 90 90 90 90 90 90 Φ....Θ.. ..ÉÉÉÉÉÉ
001E 4200: B9 50 5C 77 00 E9 E5 14 01 00 90 90 90 90 90 90 ╣P\w.Θσ. ..ÉÉÉÉÉÉ
001E 4210: 68 20 42 5E 00 E8 12 BD 01 00 59 C3 90 90 90 90 h B^.Φ.╜ ..Y├ÉÉÉÉ
001E 4220: B9 50 5C 77 00 E9 46 16 01 00 90 90 90 90 90 90 ╣P\w.ΘF. ..ÉÉÉÉÉÉ
vm2.exe
001E 41A0: 68 80 F8 5D 00 E8 82 BD 01 00 59 C3 90 90 90 90 hÇ°].Φé╜ ..Y├ÉÉÉÉ
001E 41B0: E8 0B 00 00 00 E9 16 00 00 00 90 90 90 90 90 90 Φ....Θ.. ..ÉÉÉÉÉÉ
001E 41C0: B9 21 5C 77 00 E9 4A 10 01 00 90 90 90 90 90 90 ╣!\w.ΘJ. ..ÉÉÉÉÉÉ
001E 41D0: 68 E0 41 5E 00 E8 52 BD 01 00 59 C3 90 90 90 90 hαA^.ΦR╜ ..Y├ÉÉÉÉ
001E 41E0: B9 21 5C 77 00 E9 A9 11 01 00 90 90 90 90 90 90 ╣!\w.Θ⌐. ..ÉÉÉÉÉÉ
001E 41F0: E8 0B 00 00 00 E9 16 00 00 00 90 90 90 90 90 90 Φ....Θ.. ..ÉÉÉÉÉÉ
001E 4200: B9 20 5C 77 00 E9 E5 14 01 00 90 90 90 90 90 90 ╣ \w.Θσ. ..ÉÉÉÉÉÉ
001E 4210: 68 20 42 5E 00 E8 12 BD 01 00 59 C3 90 90 90 90 h B^.Φ.╜ ..Y├ÉÉÉÉ
001E 4220: B9 20 5C 77 00 E9 46 16 01 00 90 90 90 90 90 90 ╣ \w.ΘF. ..ÉÉÉÉÉÉ
The first 3 diffs are different by 30h. Interpreting the diffs as bytes in an aligned 4-byte words, the first one is 775C51B9h vs. 775C21B9h, which is off by 3000h.
I don't have the output in front of me, but when we looked this offset up in CFF Explorer, it looked to be a jump table of sorts. It was something like
mov cx, (constant)
jmp (another constant)
Of these two constants, one matched and the other was the same diff above (775C51B9h vs 775C21B9h). I don't remember which was which off the top of my head, but I do remember what was at the target of the jumps. Following the jumps, and comparing it to a .map of the build, it looks to be the global static constructor table ($E18 or $E24, iirc). The first offending entry is the static constructor that sets up cin. The other two are cout and cerr.
The identical build machines are using an embedded celeron processor with a gig of ram running XP Pro Sp2. The VM is VMWare player, the most recent version, running XP Pro Sp2 and MSVC++ Enterprise Edition.
Does anyone have any insight? Thanks!
|
|
|
|
|
_aesthetic_ wrote: reproducible, bit for bit, as it will be subject to auditing
sh*t - who are you using for auditing ? the gestapo ? we have PWC as external auditors where I work and we've never been asked to do this.. what we do have to prove is that the build can survive regression testing, for example ..
_aesthetic_ wrote: Is it possible to specify their build and link orders short of a .bat file?
you can of course use make (or 'nmake') files with vc6 - while that would give you a consistent build (order) across your three machines, Im not sure it would help at the binary level - try it and see
.. it seems like a complex issue, good luck
|
|
|
|
|
Project > Settings > Link tab, there's "link incrementally", "ignore default libraries", and some other settings. Unfortunately doesn't show you the whole build command like 2005, but that's where I'd start.
|
|
|
|
|
Interesting. I just tried this with a medium sized program (about 1 MB code) and the only difference is 1 byte at address 100h (which I believe is a time stamp).
I'm using VC6, SP6 + Processor Pack.
Which SP are you using?
|
|
|
|
|
Hee-hee - I've been through this sort of pain - except we had it easy - we were developing an embedded system, so we had no OS (and no OS loader), so had a raw binary (an S-Record file) that we could compare. That had no timestamps, no fixups, no extraneous metadata. Easy!
_aesthetic_ wrote: Is it possible to specify their build and link orders short of a .bat file
A response file[^]? Can you stick a list of all the object and library files into a text file and use that on your command line.
I'd recommend getting away from using the IDE to build. Create yourself a makefile or something - give yourself control over the build process.
To be honest...could you not save yourself a whole heap of pain by configuring binaries in your version control system as part of your release procedure - that way you always have the released code.
BTW - why is your auditor going to be getting quite so het up about this? Do you have some sort of certification authority to satisfy? The FDA or something? If not, then you really, really don't need this level of reproducibility.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I want to write a small mfc dialog app that executes some code when the user changes the desktop settings (resolution / color depth), but I want to execute this code before the event occurs (so I can store current window position before the layout changes). I have not had much luck googling this, can someone point me in a direction?
Thank You -
Mike
|
|
|
|
|
rognorak wrote: (so I can store current window position before the layout changes).
You mean your size settings are automatically updated when the display resolution changes?
Btw, I am not sure about such a message that will inform before the display change. But I wonder if you can't store the size informations always (at the beginning itself). So that when you get the display change message you can make the use of them.
- ns ami -
|
|
|
|
|
Well what I am doing is switching between clone and extended desktop. What I want my app to do, is remember the position for each configuration, so for instance, when I switch back to extended desktop, it will return all windows to the position they were in before I had switched to clone. I dont want to constantly be polling window position, so I wanted to be notified right before the resulution was changed so I could store the last known position before the resolution changes in each configuration -
Any Thoughts ?
Thanks -
Mike
|
|
|
|
|
I think I have no such experience.
Who is updating the position when the desktop is changed?
I was thinking, if it is done in our code, we can store that.
- ns ami -
|
|
|
|
|