Question : Visual Studio creates an error in my rc file every time I change a menu

Each time I modify my RC file to add/change a menu item, Visual Studio automatically updates the file and puts a malformed line at the end  

It inserts the line
1 TYPELIB "TestOKEv3.tlb

The compiler them correctly complains about an unexpected end of file file since the the line is missing the terminating quote.  

If I go in and modify the line to add the terminating quote, then I get the message
.\TestOKEv3.rc(339) : error RC2135 : file not found: TestOKEv3.tlb

which seems appears to be the case as I don't see a tlb generated for the project though there is an TestOKEv3.idl file that was create (see below)

I can get the program to compile and link if I delete the entire statement, but I'm guessing that's not the best alternative and maybe causing other (or future problems) and its really annoying to have to go in each time to manually make this change.

How do I get the statement to be correctly generated and the TLB file generated (OR if I should haven't the TLB file/statment in the first place

What happens if the TLB file is not included?

Thanks
Marvin

I've included 3 text snippets:

1) The Top of the RC file which there is a refereince the the TYPELIB in the TEXTINCLUDE section
2) The bottom the RC file where the error occurs
3) the contest of IDL file that was created
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
******* FROM TOP of the RC (TEXTINCLUDE section which references the Projects TLB file  ******
 
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
 
1 TEXTINCLUDE 
BEGIN
    "resource.h\0"
END
 
2 TEXTINCLUDE 
BEGIN
    "#include ""afxres.h""\r\n"
    "\0"
END
 
3 TEXTINCLUDE 
BEGIN
    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
    "#define _AFX_NO_OLE_RESOURCES\r\n"
    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
    "\r\n"
    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
    "LANGUAGE 9, 1\r\n"
    "#pragma code_page(1252)\r\n"
    "#include ""res\\TestOKEv3.rc2""  // non-Microsoft Visual C++ edited resources\r\n"
    "#include ""afxres.rc""         // Standard components\r\n"
    "#endif\r\n"
    "\r\n"
    "1 TYPELIB ""TestOKEv3.tlb\0"
END
 
 
 
 
******************************************************************
****** BOTTOM Part of the RC file ******************************
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
 
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE 9, 1
#pragma code_page(1252)
#include "res\TestOKEv3.rc2"  // non-Microsoft Visual C++ edited resources
#include "afxres.rc"         // Standard components
#endif
 
// FROM MARVIN: NOTE THIS IS THE LINE THAT IS MALFORMED BY Visual Studio
1 TYPELIB "TestOKEv3.tlb
/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED
 
 
**************************************************************
*** IDL File contents *****************************************
// TestOKEv3.idl : IDL source for TestOKEv3
//
 
// This file will be processed by the MIDL tool to
// produce the type library (TestOKEv3.tlb) and marshalling code.
 
import "oaidl.idl";
import "ocidl.idl";
 
[
	uuid(20846FA6-840B-4954-9521-3A8E407EBD21),
	version(1.0),
	helpstring("TestOKEv3 1.0 Type Library")
]
library TestOKEv3Lib
{
	importlib("stdole2.tlb");
};

Answer : Visual Studio creates an error in my rc file every time I change a menu

>>>> do you know when those values would have  have been setup (and possibly when they could have been malformed).

These values were created with the project when you created it using the wizard.

As far as I know there are only two changes to update them. Either manually by editing the resource file in the text editor (or by replace-in-files) or by editing in Visual Studio via Edit - Ressource Includes.

But I must confess that I only made little things where a type library or a MIDL compiler was needed. The wizards of these add-ons may use the resource file as well and may have malformed it. The problem is that it is one-way. If a wizard once has written to the rc file there is *no* chance to get it corrected as these parts were not managed by Visual Studio.

Random Solutions  
 
programming4us programming4us