|
You have at least two options :
- in your project settings, check the "Force output" box in the Link / Customize tab.
- add a fake exported function, such like __decl(dllexport) void suckmeall(){} , this will force the linker to produce a .lib library.
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
None of your proposed solutions work
The only files produced are these:
- testdlg.obj
- test.obj
- test.pch
- test.res
- stdafx.obj
- vc60.idb
- vc60.pdb
But no test.dll, nor test.lib
Before I added the dialog, it worked. But now, even when I "comment" the references to testdlg, it doesn't. So, it has something to do with that dialog I guess...
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
After completely removing the dialog from the resource, and deleting the dialog's header and source file from the project, the project created a lib- and dll-file again.
There's still a resource in the project (string table and version info).
So, can't we add a dialog into a dll using the resource editor?
Do I have to use mfc-extension dll or regular dll using shared or static mfc-dll?
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
Hi, i'm writing an app which will have its own DB that it will add information to
from searches from various databases (so they have a local copy of search results etc)
Now, which database option should i use, bearing in mind that its a stand alone app and the user could be anywhere ?
I'm told there is a free sybase db, i could use the jet engine?
erm what do people recommend?
Bryce
|
|
|
|
|
I want to remove popup menu that popup when I right mouse click on CHtmlView.
First, I try to map message WM_INITMENUPOPUP in CMyHtmlView, but my message handler has not been execute.
I don't know how can I remove the popup menu.
Please help me.
|
|
|
|
|
erm i use a bit of html code
eg
<br />
<BODY onLoad="start()" bottomMargin=0 leftMargin=0 topMargin=0 rightMargin=0 scroll = 'no' oncontextmenu="return false" bgColor=white><br />
bryce
|
|
|
|
|
hi,
I'm using a CComboBox in toolbar.when i try to resize it,a separator appears behind the combo box.I tried removing TBBS_SEPARATOR but then it does shrinks back to toolbar button width.Also.if I try to specify CRECT right value, then it overwrites the next button.this separator can be seen when toolbar button size is increased
How to remove it?
thanx in advance !
viraj
|
|
|
|
|
Hi all,
For years I've been using C format strings to create output strings that are written in message boxes, in files, ... You know, constructions like this:
printf ("Error found on line %ld in file %s", LineNumber, FileName);
This constructions makes it easy to add translations to your application:
printf (Translate("Error found on line %ld in file %s"), LineNumber, FileName);
The Translate function can then translate this english string to a french string.
There are some problems with this construction. First, the order of arguments in the format string must remain the same throughout all languages. Second, errors in the translations can crash your application.
Using C++ iostreams makes things much better, but I have to write things like this:
cout<<"Error found on line "<<LineNumber<<" in file "<<FileName;
Now try to add translate functionality to this, without translating silly strings like " in file ".
I once saw a construction where they used :1, :2, ... to replace the format specifiers, but I can't remember where I saw it. Format strings looked something like:
"Error found on line :1 in file :2".
The translated string could then be:
"Error dans le fichier :2 sur la ligne :1"
Notice how the order of the arguments was changed.
So this construction has the advantage that the sequence of :1 and :2 can be modified in other languages, and that the application will not crash if there's an error in the translation.
There's probably some nice C++ class to implement such construction.
Now how do I specify that :1 is my LineNumber, and :2 is my FileName?
Is it possible to put something like this functionality in a C++ class, and make it work similar like cout? Or does this already exist? Anyone ideas on how to find or write this ?
Enjoy life, this is not a rehearsal !!!
|
|
|
|
|
You can use sprintf to use a normal printf style formatting into a char array, and then cout that
e.g.
szErrorFormat = "Error found on line %ld in file %s";
sprintf( szOutputBuffer, szErrorFormat, nLineNumber, szFileName );
cout << szOutputBuffer;
(this code is just an example - don't expect it to compile!)
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
That's a solution, but not the one that I was searching for.
I am rather hoping/searching for a solution like this:
<br />
class StringFormatter;<br />
StringFormatter myFormatter("Error found on line :1 in file :2");<br />
myFormatter << LineNumber << FileName;<br />
cout << myFormatter;<br />
The StringFormatter could also automatically translate the given string. The order of the :1 and :2 would not matter (in contrast with using %ld and %s in a normal C format string), so it could be translated into:
Erreur dans le fichier :2 sur la ligne :1
(I hope this is right since my french is a bit rusty).
Does such class exist?
If I would want to write something myself, what would be a good starting point, or what pitfalls should I avoid?
Maybe a good idea for a CP article?
Enjoy life, this is not a rehearsal !!!
|
|
|
|
|
You could use the Win32 function ::FormatMessage to format your strings. It allows specifying arbitrary order on the arguments. It is a little bit of a pain to use, but you could easily wrap it inside an object to simplify the calls.
If you are using MFC and CString, you can use the FormatMessage member of CString, which wraps the Win32 function so that it is easier to use.
Best regards,
John
|
|
|
|
|
i want to get info from file manage, i.e. files, directories etc. i mean, directly, not by findfile functions.
but i have no idea how to accass to file manage, is it private property of microsoft, so we can't use it directly?
thx
includeh10
|
|
|
|
|
You mean accessing NTFS data structures directly? Sure, anyone can do that. You just have to hand over a small amount of cash and you can buy your way into the world of NTFS drivers.
If your bankaccount is below 6 numbers in US$ better forget it.
...if you're under 8 or younger. Chris Maunder, the Lounge
|
|
|
|
|
i am in the middle of an app, the app is a large one, so far, pure h/cpp code is over 4M.
a terrible problem happens now:
in release version, if open more than 5 documents at same time (by OpenDocumentFile() function), the app crashes.
in debug version, i even can't open any.
debug says:
BOOL CObject::IsKindOf(const CRuntimeClass* pClass) const
{
ASSERT(this != NULL); //problem at the line
// it better be in valid memory, at least for CObject size
ASSERT(AfxIsValidAddress(this, sizeof(CObject)));
// simple SI case
CRuntimeClass* pClassThis = GetRuntimeClass();
return pClassThis->IsDerivedFrom(pClass);
}
do you know why and how to fix it?
thanks for any idea.
includeh10
|
|
|
|
|
includeh10 wrote:
ASSERT(this != NULL); //problem at the line
If this assert fires (in DEBUG mode), obviously this must be NULL.
Maybe the call came from a static function(not having associatied object) or from a global function.
Finding that call and guarding against this error should be possible if you use the call stack.
Maybe we can help you again when you show the context of this call.
|
|
|
|
|
I want to create COM dll that will fire events and transfer data to its clients. Is it possible to create such dll without being an ActiveX control
|
|
|
|
|
Of course, it's just a normal COM without implementing the interfaces needed by ActiveX.
|
|
|
|
|
That's not a matter of ActiveX.
Your COM component must implement the IConnectionPointContainer interface, and provide one or more IConnectionPoint which are event sources.
if you start putting in too manay features, it no longer remains useful for beginners
quote in a CP article comment, shiraz baig
|
|
|
|
|
Can you make a secure download with CHttpSession? One that accepts certificates or allows you to accept it? I tried setting the secure flag but it times out. I assume waiting for a certificate to be accepted. Any thoughts?
Darroll
Not one person lives in the present. Only the past. I can prove it.
|
|
|
|
|
In VS.net, when we open a cpp file, header file, resources, even the help pages, they are showing in the same tabpage-like pane. How can I create something similar ?
Any open source controls like it ?
Should I create different multiple document templates for each types of documents ?
|
|
|
|
|
Hi,
In a dialog based application, I need call a function which is located in another class. In order to call this function, i need the handle of the main dialog.
My problem is how to get the handle of the main dialog and transfer it into the function call? (Some lines of example code ?)
By the way, what is the handle of a menu item and how to get/use it?
Thanks in advance!
chen
|
|
|
|
|
AfxGetMainWnd() from memory. It will need to be cast to an instance of your dialog.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
One solution to updating a parent windows with data from a dialog box is via messaging. Send the parent windows a message. You could send a pointer to the data. A better solution is just to notice the parent window and have it call a function in the dialog box.
Kuphryn
|
|
|
|
|
Thanks for thr reply!
In fact, my problem is:
I need call the function
void CAspi32Scsi::WriteCD2ImgFile(HWND Handle, CString fileName, int hid, int tid, int lun)
{
.....
}
in the maindlg implementation loop.
so I have
CAspi32Scsi m_scsi; // this is defined in the CMainDlg class.
CMainDlg::OnWriteImgFile()
{
CMainDlg maindlg;
m_scsi.WriteCD2ImgFile(maindlg.m_hWnd, m_fileName, m_cHost, m_cID, m_cLun);
}
where maindlg.m_hWnd is correct or not?
Thanks in advance!
chen
|
|
|
|
|
in OnWriteImgFile() ur creating another CMainDlg and accessing its handle, its like from within ur dialog, ur creating another one and getting its handle, i dont think that's what u want!
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|