|
Richard MacCutchan wrote: edit]I see the prat one-voter has been creeping around ... I don't mind being down voted for my suggestion, but at least have the courage to tell me why I'm wrong.[/edit]
Who so ever he/she was, let me square it! 5 points for your post!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
You, sir, are a true gentleman, thank you.
It's time for a new signature.
|
|
|
|
|
Hi!
When I run my application, it crashes at this line curTab->getElementFromId(i)->remove(); and displays:
Unhandled exception at 0x00632175 in SlogOut3D.exe: 0xC0000005: Access violation reading location 0x00000000. When I view the Memory contents at this location 0x00632175, it has:
8b 11 8b f4 8b 8d 18 ff ff ff 8b 42 18 ff d0 3b f4 e8 3e 64 ee ff eb b1 5f 5e 5b 81 c4 e8 00 00 00 3b ec e8 2c 64 ee ff 8b ...ô...ÿÿÿ.B.ÿÐ;ôè>dîÿë±_^[.Äè...;ìè,dîÿ.
curTab is a pointer.
What is wrong with this program? How to run with out crash?
|
|
|
|
|
"0xC0000005: Access violation reading location 0x00000000" means you are using a NULL pointer.
So either curTab is NULL or getElementFromId(i) returns NULL. You can fix the crash by checking the curTab-pointer and the pointer returned by getElementFromId(i) before using it.
|
|
|
|
|
Hi all,
i draw a rectangle by CDC::Rectangle function,
CDC* pDC;
CRect rect(10,10,50,50);
pDC->Rectangle(rect);
CBrush brush;
brush.CreateSolidBrush(RGB(210,210,210));
pDC->FillRect(&rect,&brush);
before using FillRect function Rectangle boundries are visible properly but when i user FillRect to Fill color in rectangle the rectangle boundaries are not visible.
and i am insert text in this rectangle,with TextOut function i also want to set the background color of the text as same as rectangle color.
please help me for this.
thanks in advance.
|
|
|
|
|
You probably need to use InflateRect() [^] or similar to change the limits of your rectangle before you do the fill, in order not to overwrite the borders. As to the text I think SetBkColor() [^] will probably do it.
It's time for a new signature.
|
|
|
|
|
|
You're welcome - don't forget to vote up the good replies.
It's time for a new signature.
|
|
|
|
|
alternatively you could first fill the rectangle, then draw the rectangle's outline.
|
|
|
|
|
That is illogical Captain.
It's time for a new signature.
|
|
|
|
|
depends on how your rectangle is defined and what tools are available for filling.
In .NET you could easily do
Graphics.FillRectangle(...);
Graphics.DrawRectangle(...);
using the same rectangle for both, not having to insect by an amount that depends on the pen characteristics.
BTW: if it works well, it doesn't have to be logical all the time!
|
|
|
|
|
Yes, it always depends ...
I know there are some rules in Win32 about where the rectangle actually ends relative to its start point and width or height, so one has to take that into account when rendering this sort of picture. I may run some tests later to remind myself how to do it.
It's time for a new signature.
|
|
|
|
|
Hello folks!
I am using this[^] method to control the initialization order of some global objects. I have (plans for) a class that will be instantiated all around the code, all instances will be globals, i was wondering, is there maybe a way to specify that i want all instances of this class instantiated in a given segment so i don't have to use
#pragma init_seg("aseg$x", some_method);
CIWantThisInSegX whatevera;
CIWantThisInSegX whateverb; everywhere and instead i can just create the instances and they will be placed in the correct segment "automatically"? Maybe by specifying a new operator for it? If it was possible it would help a lot because it is enough to forget the init_seg part only once and havoc might get loose.
Thanks in advance for any ideas.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
Hello to all,
In my project, a multiline edit box is there on dialog box and I am displaying lets say some 3-4 lines of text in edit box. Now what i have to do is, I want to display each line with different font in edit box means each line will have different font. So is it possible to do it? if possible then how to do it? can anyone tell me how to do it?.
it is really very very urgent so please help me out.if possible plz send me sample code.
Thanks and Regards,
Anay
|
|
|
|
|
AnayKulkarni wrote: Now what i have to do is, I want to display each line with different font in edit box means each line will have different font.
You'll have to use Rich Edit control for that purpose, because the edit box is not capable of showing text with different fonts.
If you are using MFC check out this[^] tutorial for the Rich Edit control.
If you are not using MFC than this[^] MSDN article could be useful for you.
|
|
|
|
|
File drag and drop operation initialize COleDataObject.
If i want to initialize it without drag and drop then how to create and initialize COleDataObject class object.
If i have a character array which contains some data then how to pass this array data to COleDataObject class object.
How to set a filename in COleInsertDialog without using its domodal method
|
|
|
|
|
MKC002 wrote: If i have a character array which contains some data then how to pass this array data to COleDataObject class object.
I suspect you'll need to use the Attach() or AttachClipboard() method.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
|
If you are using LoadLibrary, you don't need to link to any library.
Where does this dll come from ?
|
|
|
|
|
I have created this dll and trying to call them.
First i got this error
"Error 1 error C2664: 'GetProcAddressW' : cannot convert parameter 2 from 'const char [6]' to 'LPCWSTR' c:\Users\Indumathi\Documents\Visual Studio 2005\Projects\Win32 DLL\Win32 DLL\NestedDLL.cpp 33"
To overcome this i added
_AddFunc = (AddFunc1)GetProcAddress(hInstLibrary,Text("MyDLL"));
After adding this Text command in GetProcAddress I got this error
<b>"Error 1 error LNK2019: unresolved external symbol "public: __cdecl std::exception::exception(char const *)" (??0exception@std@@QAA@PBD@Z) referenced in function "public: __cdecl std::bad_alloc::bad_alloc(char const *)" (??0bad_alloc@std@@QAA@PBD@Z) NestedDLL.obj ">
</b>
To solve this i added .lib file in the Additional Library in Linker tab
Once did that all the error went and i got this error
"Fatal error LNK 1180 cannot open input file"
I am new to VC++ and i have no idea how to solve this.
pls. help me to solve this.
|
|
|
|
|
Ok, so either you link to your library and call the functions direclty, or you use LoadLibrary and GetProcAddress. But it doesn't make any sense to link to your library and use LoadLibrary. I strongly suggest you read some tutorials about dlls (there are plenty of articles available on CP).
|
|
|
|
|
Is there an article for wince win32 dll.
Because I found many links and all for win32 projects and for smart device in VC++.If so, can u please give me the link.
.It would be grateful if send me the link
|
|
|
|
|
induvijay wrote: "Error 1 error C2664: 'GetProcAddressW' : cannot convert parameter 2 from 'const char [6]' to 'LPCWSTR' c:\Users\Indumathi\Documents\Visual Studio 2005\Projects\Win32 DLL\Win32 DLL\NestedDLL.cpp 33"
This is because you're either explicitly calling GetProcAddressW (which is not the best way of doing it) or your project is Unicode. In either case, you're using char , but you should be using wchar_t for the call to succeed. Or do an ANSI build, which would call GetProcAddressA .
It's time for a new sig. Seriously.
|
|
|
|
|
induvijay wrote: "Error 1 fatal error LNK1181: cannot open input file 'C:\Users\Indumathi\Documents\Visual.obj'"
You should fix this problem first. What is this file and why is the linker trying to include it?
It's time for a new signature.
|
|
|
|
|
I have no idea.even i searched in my local directory its not there.
I included my library file in the Additional Library include.once i did that this error occurs
|
|
|
|