|
hi all :
As far as I know,to create a source file in visual studio 6.0 is not that easy as push a button,but: file->new->files->c++ sourcefile?please help me
|
|
|
|
|
wb_program wrote: As far as I know,to create a source file in visual studio 6.0 is not that easy as push a button
Maybe you need to get one of these[^]
|
|
|
|
|
There's a toolbar button for creating a new text file. When you save the file, give it a .cpp extension.
|
|
|
|
|
Is it possible to add a new string resource at runtime? e.g. I would like to add "My Custom string" with the resource ID "IDR_CUSTOM_STRING" (with some unused value) to the string table.
We wish to allow our customers to customize the application. e.g. where it by default says 'Some Program' and 'Some file type (*.som)', they might use 'Bob's Program' and 'Bob's files (*.bob)'. That info in particular is all encoded into the IDR_MYPROGTYPE resource in the string table. The constructor for CMultiDocTemplate only uses this resource to set those strings as needed. I could define a new entry in the string table, and use that, but that works for only a single customization. To allow complete flexibility, I want want to generate a new string table entry based on some data file that is accessed before the DocTemplate is created (early in CMyWinApp).
As the resources themselves as part of the exe seems frought with problems, so I am happy to leave that alone. It just seems that at some point that data must be loaded and allocated somewhere, somehow. I just want to add a new one.
Or... if there is a safe way to do it, just modify the existing one.
Thanks,
-G
|
|
|
|
|
Look at BeginUpdateResource.
|
|
|
|
|
How about this[^]?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
I had seen ::UpdateResource() before but it operates on a file, not from with the same program. Oh, well. If I have to make a utility app to do it externally, so be it. At least now I have a template function to do the mechanics of changing the string without having to think about it too much.
Thanks for you help
-G
|
|
|
|
|
|
The PortOpen property looks promising. Have a look at the MFC VCTERM [^] example.
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]
|
|
|
|
|
Hello,
I'm writing an MFC app that accesses a database. In the event of a DB user being denied access to a database object, I disable the relevant CView through an EnableWindow(FALSE) call. This works well. However, it has the potential to confuse users, who may wonder why the CView cannot be interacted with - is it a bug? Therefore, I'd like to have some obvious visual indication that the view cannot be interacted with, such as darkening it.
I'm not sure how a view can be darkened. I'd be willing to settle for some other obvious visual indication if it was easier to implement.
What approach is suggested?
Thanks in advance,
Sternocera
|
|
|
|
|
Sternocera wrote: I'd be willing to settle for some other obvious visual indication if it was easier to implement.
Are you wanting the view to be read-only (i.e., they can see records but can't edit them), or hidden?
"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
|
|
|
|
|
They can't see the records anyway - the view won't get populated. This is a database level permission. I already have the entire view non-responsive through my call to EnableWindow(FALSE) - from there, I just want a big visual cue that the view is not interactive, such as darkening the view.
Thanks
|
|
|
|
|
Sternocera wrote: ...I just want a big visual cue that the view is not interactive, such as darkening the view.
Well, you could always close the view, or create a separate view that simply contained the text, "You do not have permission..."
"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
|
|
|
|
|
What does it mean to close a view? Replacing my view with another view would probably be very clunky with my existing design - I suspect I will have to do some drawing to the view.
I'd rather have something that is based on the view when permission is not denied, such as a darkened version of the same thing, or overlaying of a padlock icon. That way, the user may get familiar with the general layout of the program without necessarily being able to use it all.
Regards,
Sternocera
|
|
|
|
|
Here's how far I've got:
void CCommonBaseView::OnDraw(CDC* pDC)
{
if(view_is_disabled)
{
pDC->SetDCPenColor(RGB(0,0,0));
pDC->SetROP2(R2_MERGEPEN);
}
CFormView::OnDraw(pDC);
}
It ought to be possible for me to change the way that we draw to the device context through the CDC pointer, and make the CView appear different somehow - darkening it, or making it grayscale, or something else. I don't seem to be having much luck drawing to the device context after the base class implementation has been called; It just makes swathes of gray turn white.
What approach is suggested?
Regards,
Sternocera
|
|
|
|
|
Come on guys, I'd really like to get an answer to this! How can I draw onto a CScrollView from its OnDraw() to change its appearance significantly, such as making it grayscale or darkened?
Thanks,
Sternocera
|
|
|
|
|
Hi,
I have a multi threaded application which crashes at mfc42!CMapStringToString::GetAssocAt+14. Please see the DebugDiag tool output below.
Function Arg 1 Arg 2 Arg 3 Source
mfc42!CMapStringToString::GetAssocAt+14 07c59d50 086cf9a8 086cf9b4
mfc42!CMapStringToPtr::Lookup+12 07c59d50 086cf9d0 00000000
DataConverter+24d57 07c59d50 086cf9d0 00000000
DataConverter+1ce5e 07c59d50 086cfa04 73ed4343
DataConverter+436cb 105868f0 000003e4 07d13bb8
DataConverter+411ba 00425047 0000000b 00000000
DataConverter+40731 7c83e828 ffffffff 7c83e825
DataConverter+2d53e 0000000a 07d13bb8 00000000
DataConverter+539c0 0000000a 07d243f8 00000001
DataConverter+53887 00000000 07d13d30 07d13c68
mfc42!_AfxThreadEntry+119 0012f028 00000000 00000000
msvcrt!_endthreadex+a3 07d13c68 00000000 00000000
kernel32!BaseThreadStart+34 77bcb4bc 07d13c68 00000000
I'm just wondering at the two MFC42 calls on top. These two are from two different classes. If my understanding is not wrong, it has to call GetNextAssicAt() method in CMapStringToPtr class but calling the method in CMapStringToString class. Could somebody help me here?
This application runs for few hours and processes thousands of messages and crashes randomly. Every time it crashes, points at same memory address.
Event description for crash: Faulting application DataConverter.exe version 1.0.0.0, faulting module mfc42.dll version 6.6.8063.0, fault address ox000234e4
Thanks in advance.
Mallik
|
|
|
|
|
This sounds like a kind of race condition to me. Are you accessing this map from two separate threads ? If yes, make sure that you protect the map against concurrent access (with a critical section for instance). The problem might appear because two threads access the map at the same time, so the map is in an invalid state for one of the thread.
|
|
|
|
|
Hi Cédric Moonen,
Thank you for the response.
This Map is completely used by one thread but still I want to implement your suggestion and test it.
If you notice the MFC42.dll calls, there is something strange. I'm not understanding why CMapStringToString class's GetAssocAt() is called. It is supposed to call CMapStringToPtr class method.
thanks,
Mallik
|
|
|
|
|
HI All,
I have one ocx control developed in vc++/mfc and later the same code has been modified to use in automation server..now the problem is we need to keep separate clsid for the ocx control for server to avoid any conflict but its not changing the clsid even after changed in odl file..
Please show the right way to do this.
Thanks..
SoftwareDeveloper(.NET)
|
|
|
|
|
How do you know that (I'm assuming you've succesfully built the component with the new CLSID )?
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]
|
|
|
|
|
Checked in the registry and found another folder with different name and same clsid..
using regedit.
Thanks..
SoftwareDeveloper(.NET)
|
|
|
|
|
Cannot you find the new CLSID in the registry?
Have you changed the interface name? Cannot you use the Oleview tool?
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]
|
|
|
|
|
In ADO DB when should be a value converted to _bstr_t or _variant_t anf why ?
modified on Tuesday, May 19, 2009 12:51 PM
|
|
|
|
|
when: when you need a BSTR or a VARIANT
why: because you need a BSTR or a VARIANT
|
|
|
|