|
The instruments don't have a serial number at this time, but the idea of generating a unique computer ID based on hard drive or Ethernet card would work. These are not advanced users, so they'd never figure this out. Thanks for the ideas.
mark.
Mark Malin
(00==[||]==00)
|
|
|
|
|
See:- http://www.inner-smile.com/nocrack.phtml[^]
The disadvantage with that method is what happpens when the user changes their hard drive etc?
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
Hi all,
I have an issue I can't seem to overcome regarding compiling code in Win2k, that I had working in
the past under Windows 98.
All the code does is set up DirectDraw7, and then do some simple page flipping.
I get an Application Error -- 'The instruction at <blah> referenced memory at <bleh>. The memory could not be "written"'.
Interestingly, if I use my old Win98 compiled .exe, or if I recompile under 2000, it makes no difference. The program compiles and links, but as soon as it executes it crashes with this error.
Debugging step-by-step doesn't seem to help either, since it seems to jump straight to nasty system-level assembly code.
I had wondered if anyone here has had the same problem.
I wonder if doesn't perhaps have anything to do with the way I start up the app? Does anything here need to be changed?
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
Please, I would be most appreciative if anyone could help me at all with this... I have deadlines for a graphic application I need to code that are nearing.
If anyone needs to see the code, just let me know how I can get it to you (email/icq/IRC etc.)
Thanks.
|
|
|
|
|
Hi,
How can I create a program that it has a status symbol as tray icon and it doesn't became hide when user doesn't activate it at XP OS !?
Thanks
|
|
|
|
|
Make a cuple of icons that looks the same, then change the icon every minute or so, then xp thinks you updated something and that it better show that
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi,
How can I create a program that it has a staus symbol as tray icon and never became hide when user doesn't activate it in XP OS?
thank
|
|
|
|
|
Hello,
I am having a problem using the LoadLibrary function. I am running into heap corruption during the call. The error I am getting is an assert of _CrtCheckMemory() in dbgheap.c.
I created the DLL with the flags MTd and LDd in the command line and I am loading it from an executable created using the Multi-Threaded Debug RTL.
Does anyone know of another way that this function call may cause heap corruption?
Stumped,
John
|
|
|
|
|
Check the global (static) valuables in the DLL. Before the actual assertion there is first chance exception, you can find the exact number from the output window. When you know first chance exception, you can probably intercept it (Ctrl+Alt+E) and see the actual function that does that.
|
|
|
|
|
I'm afraid that I don't quite know what you mean. I should also mention that this does not happen if I invoke the debugger. It only happens when I run without debugging which makes it difficult to determine exactly what is happening.
There are no global static variables directly in my source code and I cannot find any in any of the included headers.
My DLLMain simply returns true.
I know it is happening during the call to LoadLibrary because the assertion occurs before LoadLibrary returns.
Unfortunately, I have very little experience with dlls and so this is all quite new to me.
Thanks,
John
|
|
|
|
|
Check your code. Here is a tutorial on DLL.
http://www.flipcode.com/tutorials/tut_dll01.shtml
Kuphryn
|
|
|
|
|
I triend to go through this tutorial: http://www.codeproject.com/dialog/bmpdlg01.asp. However, it is for MSVC++.net. So therefore it will not work with my version of MSVC++. I was wondering how I would change the bg of a dialog either in MFC or in C++.
If anyone could help me then it would be greatly appreciated.
orcblood
|
|
|
|
|
Do the following...
// 1. Add a CBrush member function...
CBrush mBrush;
----------
// 2. In OnInitDialog...
//Load the bitmap from a file and create patterned brush.
RECT rc;
GetClientRect(&rc);
HBITMAP hBmp=NULL;
hBmp=(HBITMAP)::LoadImage(NULL,"c:\\YourImagePath\\TheBitmap.bmp",IMAGE_BITMAP,rc.right,rc.bottom,LR_LOADFROMFILE);
CBitmap *pBmp=CBitmap::FromHandle(hBmp);
m_brush.CreatePatternBrush(pBmp);
::DeleteObject(hBmp);
----------
// 3. In OnPaint...
//Paint the background with the image brush
CRect rcClient;
GetClientRect(&rcClient);
dc.FillRect(&rcClient,&m_brush);
---------------
// 4. In OnCtlColor..
// You need to do this to keep any static text controls on your
// dialog from painting a default dialog background under the static field.
switch(nCtlColor)
{
case CTLCOLOR_STATIC:
pDC->SetTextColor(RGB(....)); //Set your text color.
case CTLCOLOR_BTN:
pDC->SetBkMode(TRANSPARENT);
case CTLCOLOR_DLG:
hbr=m_brush;
}
----------------
Art
|
|
|
|
|
Hi,
i just implemented a freeware serial port OCX in
my program .... it runs perfectly !! (RSComm)
Now i want to run it on another comp.
Then the old problem occours
The program need the ocx file and some dll`s ....
Who can tell me where i can build ALL the
things needed by the program in ONE binary file ?
(i activated this in the mfc-wizard on beginning)
every hint is welcome
by the way: this can work! in another, ready
program, i saw some other ocx windows and
this program is ONE file ....
|
|
|
|
|
I'm trying to override vector's operator[] but am getting multiple errors. I have an array object derived from vector. The operator[] of vector does not check for an invalid object and always returns a pointer of the object type stored in the object regardless of whether or not that object actually exists in the array. MSDN says "If that position is invalid, the behavior is undefined". Ok, I'll buy that but that causes alot of problems in my programs that will use it cuz then I'd have to check for invalid parameters each time I call it when I'd rather do the check in the array of type vector object itself.
For example, if I have 3 objects in my derived array class and ask it to return a pointer to the 4th object in the array, or ask it to return a reference to the -1 element, it will. Slightly modified example below:
class CMyArray : public vector<CMyObject>
{
public:
CMyArray() : vector<CMyObject>()
{
}
};
I added the following code to above but get several errors, of course.
CMyObject& operator[](size_type pos)
{
if(pos < 0)
return NULL;
if(pos > size())
return NULL;
return vector::operator[pos];
};
The errors for the two if's returning NULL are:
C:\Scratch Code\myobject.h(172) : error C2440: 'return' : cannot convert from 'const int' to 'class CMyObject&'
Which I expect but really don't no what else to return to indicate an invalid index, object, or position. As for the last statement, I've gotten different errors depending on how I coded it. Don't know what's right. I've tried vector::operator[](pos) but gives me error about "ambigious call to overloaded function."
Thanks
|
|
|
|
|
NULL is a pointer, not a reference to CMyObject , so it's no wonder the compiler complains. Your only option here (to the best of my knowledge) is to throw an exception.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You might consider using the "at" function in vector instead. That function does bounds checking. That way you wouldn't have to do any specialization. "at" may throw so be sure to put the call in a try .. catch block.
PS. When checking your bounds as in your snip-it above, I think you want (pos >= size()) as your second fail condition since size() is 1 too many.
|
|
|
|
|
You're right about the (pos >= size()). I looked into at() and it looks like it will work fine. Thanks, guys!
|
|
|
|
|
Hi all!
I want to create a large bitmap, draw on it and then just display a portion of it (there is a scrolling feature in my app).
When I use the code below and set the 'picwidth' to i.e. 1000, it works just fine.
But when I set the width to i.e. 5000 just a black bitmap appears, without the white line.
There is NO error at 'CreateCompatibleDC' and 'CreateCompatibleBitmap' !
CBitmap bmp;
CDC dc2;
CClientDC dc(this);
int picwidth = 5000;
if (!dc2.CreateCompatibleDC(&dc)) {
AfxMessageBox("error");
return FALSE;
}
if (!bmp.CreateCompatibleBitmap( &dc, picwidth,512)) {
AfxMessageBox("error");
return FALSE;
}
CBitmap* oldbmap=dc2.SelectObject(&bmp);
CPen pen( PS_SOLID, 0, RGB(255,255,255));
CPen* pPenOld = dc2.SelectObject( &pen );
int nMap = dc2.SetMapMode( MM_TEXT );
for (i=0;i<picwidth;i++) {
dc2.MoveTo( i, 300 );
dc2.LineTo( i, 300 );
}
dc2.SetMapMode( nMap );
dc2.SelectObject( pPenOld );
pDC->BitBlt(5,5, 600 , 512 ,&dc2,0,0,SRCCOPY);
dc2.SelectObject(oldbmap);
Is there anything wrong in my code ?
What can I do that the 5000 pixel wide bitmap is created successfully ?
Thank you very much in advance!
Best regards,
Hannes / Austria.
|
|
|
|
|
There *is* a physical limit to bitmap size, and I reckon you've crossed it.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003
|
|
|
|
|
what's the return value of the SelectObject?
-c
Be very, very careful what you put into that head, because you will never, ever get it out. --Thomas Cardinal Wolsey
|
|
|
|
|
Hi Chris!
Which one do you mean ?
The last one ?
dc2.SelectObject(oldbmap);
..with
szMsg.Format(" %d", dc2.SelectObject(oldbmap));
AfxMessageBox(szMsg);
I get: 61047404
Thank you,
Hannes.
|
|
|
|
|
the first one, the one that selects the huge bitmap into the DC.
-c
Be very, very careful what you put into that head, because you will never, ever get it out. --Thomas Cardinal Wolsey
|
|
|
|
|
Good morning
The return values for
CBitmap* oldbmap=dc2.SelectObject(&bmp);
are:
4423188 if the bitmap creation succeeds (width = 1000)
4423204 if something goes wrong (width = 5000)
Thank you very much!
Best regards,
Hannes.
|
|
|
|
|
what is the return value from the BitBlt ?
-c
Be very, very careful what you put into that head, because you will never, ever get it out. --Thomas Cardinal Wolsey
|
|
|
|
|
Hi Chris!
Just came home from work...
I checked the return values from BitBlt and I get a 1 in both cases.
It's not surprising since the bitmap is actually drawn, but it is just black. (without the white line)
Thank you very much for working on this with me!
Very much appreciated!!!
Best regards,
Hannes / Austria.
|
|
|
|