Quantcast
Channel: Visual C forum
Viewing all 15302 articles
Browse latest View live

In a MFC Dll project only one source file gets compiled in release mode

$
0
0

I created a new Visual C++ project of type MFC dll and added several source files to it. In Debug mode they all get compiled but in release mode only one particular source file gets compiled even though all the source files are listed. If I remove all else and keep any one particular source file then that gets compiled. Thinking I might have done something wrong I even recreated the project from scratch, and still face the same problem. I haven't seen anything more bizarre than this. I'm using VS 2008 Pro. Please help before I shoot myself.


Installshield professional for 2008

$
0
0

Hi

I am migrating my application from vc++6.0 to vc++2008

When application was build in vc++6.0 successfully i created the package using intallshield professional for vc++6.

Now my application is working fine in vc++2008 with no errors. I need to know wether i can use the same installshield to build the package , or there is any new version available for 2008.

Thanks

DLL with wrong missing symbols

$
0
0

I have a program (mrViewer) which uses the ffmpeg libraries built from zeranoe together with a bunch of other libraries.   This program was compiling and running just fine.  However, now it no longer is so.  My problem is weird.  I compile and link my program without any problem.  However, when the executable is run, it complains saying __glutInitWithExit is missing in avcodec (one of the ffmpeg libraries).  Now I know for sure that ffmpeg does not link with glut at all.  When I run dependency walker I indeed see 3 functions undefined in avcodec (functions found in the glut library).  If I use dependency walker in the glut library (freeglut btw), it shows the functions defined just fine.  If I change the order of the linked libraries, sometimes the warning is different, which puzzles me more.

So I am at a loss on what to try to get my program back to working.  Something in the build process is broken, but I cannot tell what.

My program is mrViewer which can be found in sourceforge at sourceforge.net/projects/mrviewer

VIsual C++ 2012: Can you compile MFC DLL/Library from source code?

$
0
0

I am curious if it's possible to compile the MFC source code to DLL/Library from what is provided with the Visual C++ 2012 install.

If so, where would I find this information?


Hoody Hoo!

GSM based Tracking

$
0
0

Hi Everyone,

I am developing Geo-Tracking application. I am tracking device based on different methods like:

Tracking based on IP address, Wi-Fi, GPS, GSM

I want to implement tracking based on GSM. I am using VC++.

Please suggest me any third party library available or windows API, using which I can implement my Geo-Tracking based on GSM.

Thanks in Advance,

Nilesh

Overloading exported functions in C++ DLL

$
0
0

I currently have a .def file

LIBRARY "MyLib"
EXPORTS
  Foo

and code

int __stdcall Foo(int a);

1) can I overload this?

I'm told that I must instead use

#define DllExport __declspec(dllexport)

int DllExport  Foo( int a ) {
  // implementation
}
int DllExport Foo( int a, int b ) {
  // implementation
}

but some platform docs say "The DLL must export functions using the __stdcall calling convention"

2) can anyone tell me if there is an important difference between the two?

What is this dreaded __missing_type__ actually good for?

$
0
0

Can anybody please explain to me what this dreaded __missing_type__ is actually good for?
The compiler inserts this sort of place holder if it could not load a depending type libary before, that implements that type and issues error C4772.

When compiling these generated .tli headers afterwards, the compiler of course bails out with tons of consecutive error messages.

I have never encountered a single scenario where it makes sense to use these .tli files. What makes things worse is that Visual Studio leaves these files lying around when I do a clean rebuild. So I always have to manually delete these files if I run into problems. Can anybody outline a situation where using a type library with missing types may produce something useful?

At some point, the description of C4772 on MSDN is actually funny:
The title says: "Compiler Warning (level 1) C4772" and then further down: "This warning is, by default, issued as an error. C4772 can not be suppressed with /W0."

ROTFL! Here's your cat! But no, your cat is actually a dog and you can't make it stop barking.

Why does Microsoft say C4772 is a warning when it's actually an error?

BTW.: Before posting, I searched technet for "__missing_type__", but since the search separates the words and counted all posts containing either 'missing' or 'type', I got 807000 hits. I didn't fell like scanning all of them....


dll UNICODE/ANSI strings

$
0
0

I have a dll compiled with _UNICODE

I export 2 functions:

  void* foo(void* str)  //returns UNICODE string
  void* fooA(void* str) //returns ANSI string

if the dll host calls foo and has UNICODE or ANSI strings do I need to also consider this difference in my dll?


multi link list

$
0
0
What is multy linked list  how to it work please tell me and algorithm of multy linked

I'd like to make a C++ form

$
0
0

All though a total novice in C++ I am an experienced developer.

So no I need to know three things:

Where is the main routine that calls other routines?

How and where do I put subroutines?

How do I do output to the window?

I have VS2013. There is some good news, I have a copy of Horton's Begginning Visual C++.

Renee


"MODERN PROGRAMMING is deficient in elementary ways BECAUSE of problems INTRODUCED by MODERN PROGRAMMING." Me


Class and use

$
0
0

Hi,

I have two pieces of code I am trying to figure out what is happening here please help@

START_CLASS // Set up a schedule pointer for each model point // Schedule pregen_bonds; Schedule *pregen_bonds; END_CLASS

pregen_bonds=new Schedule;

Then later in a different function

return pregen_bonds->getvalue(t,3) * default_sale_survival(t);

is getvalue a function in the class pregen_bonds?

What is getvalue and where does it come from?  If you need more code just let me know.

Thanks



Where are the "semantics constraints for default-initialization" referred in the second bullet point of §8.5/8 (N3797)?

$
0
0

§8.5/8 (N3797):

To value-initialize an object of type T means:

  • if T is a (possibly cv-qualified) class type (Clause 9) with either no default constructor (12.1) or a default constructor that is user-provided or deleted, then the object is default-initialized;
  • if T is a (possibly cv-qualified) class type without a user-provided or deleted default constructor, then the object is zero-initialized and the semantic constraints for default-initialization are checked, and if T has a non-trivial default constructor, the object is default-initialized;
  • if T is an array type, then each element is value-initialized;
  • otherwise, the object is zero-initialized.


VS 2013 error LNK1104: cannot open file atlsd.lib

$
0
0

I'm trying
to get a VS 2010 C++ ATL based dll to compile in VS 2013.  I'm getting the
following link error: <o:p></o:p>

error LNK1104: cannot open file atlsd.lib   

I've not
been able to find any references to this library in the project
properties.  How do I fix this

I'm aware that the atl libraries have changed in VS 2013 but have not been able to figure out how to correct the link problem.


AliciaV

VS 2013 regsvr32 buffer too small error when registering a COM dll

$
0
0

I have a atl/COM base solution I'm trying to convert to compile under VS 2013.  Whenever VS tries to register a dll I get this error (in part):

Microsoft Visual C++ Runtime Library

Program: C:\Windows\SysWow64\regsvr32.exe

File: f:\\dd\vctools\crt\crtw32\studio\vswprintf.c

Lin: 280

Expression: ("Buffer too small",0)

How do I get VS 2013 to successfully register a COM dll being build?


AliciaV

Why can't I use HWND from GetDesktopWindow() to draw lines on desktop screen using Direct2D

$
0
0

Hello everyone,

I am working on a desktop application that is somehow related to gestures.

The goal is to draw a path or a line on the desktop screen when user performs a certain gesture.

I managed to do this using GDI+ classes but I wanted to try and use Direct2D because it renders better.

I tried using ID2D1Factory::CreateHwndRenderTarget method and passing the HWND returned from GetDesktopWindow() but I can't seem to get any lines drawn on screen.

Although when using the HWND parameter in the WndProc() method, I can draw the lines on the demo app window.

Btw, I am using the DrawRectangleExample as base code for this trial.

Is there another way to draw on the desktop screen using Direct2D?

Hoping for your opinions.

Thanks and best regards,


midl : error MIDL2019 : error accessing type info

$
0
0

Hi All,

I'm migrating an application from vc ++ 6.0 to visual studio 2008. I get the MIDLError on Rebuild of my project, while thiserrors does not appear on Build. I'm not able to figure out why this error occurs and how to fix it.

I went through the posts related to MIDL error and tried the fixes proposed in those similar posts, but nothing worked out. Links that I refered are below,

http://social.msdn.microsoft.com/Forums/vstudio/en-US/29306336-40d4-4ce7-bb9f-d3081bc85222/error-midl2019-error-accessing-type-info-error-executing-midlexe?forum=vclanguage

http://social.msdn.microsoft.com/Forums/en-US/be4cac5f-caac-4322-89c9-a674875c8419/why-do-i-get-error-midl2019-when-building-as-administrator?forum=vcgeneral

Please refer below the Output and Build Log attached for reference:

(Portion of the output where error occurs) 

1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\msxml.idl
3>msxml.idl
6>oaidl.acf
8>msxml.idl
7>oaidl.acf
6>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\ocidl.acf
7>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\ocidl.acf
1>msxml.idl
4>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\oaidl.acf
6>ocidl.acf
7>ocidl.acf
5>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\oaidl.acf
8>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\oaidl.acf
3>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\oaidl.acf
7>midl : error MIDL2019 : error accessing type info 
6>midl : error MIDL2019 : error accessing type info 
4>oaidl.acf
6>Build log was saved at "file://c:\C++\Audi\CustomImportRheinland\ReleaseMinDependency\BuildLog.htm"
7>Build log was saved at "file://c:\C++\Audi\CustomImportKyosuiren\ReleaseMinDependency\BuildLog.htm"
7>CustomImportKyosuiren - 1 error(s), 0 warning(s)
6>CustomImportRheinland - 1 error(s), 0 warning(s)
8>oaidl.acf
5>oaidl.acf
3>oaidl.acf
4>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\ocidl.acf
8>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\ocidl.acf
5>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\ocidl.acf
3>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\ocidl.acf
4>ocidl.acf
1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\oaidl.acf
5>ocidl.acf
8>ocidl.acf
3>ocidl.acf
8>midl : error MIDL2019 : error accessing type info 
1>oaidl.acf
1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\ocidl.acf
1>ocidl.acf
2>Compiling...
8>Build log was saved at "file://c:\C++\Audi\CustomImportFukokuAM\ReleaseMinDependency\BuildLog.htm"
8>CustomImportFukokuAM - 1 error(s), 0 warning(s)

Build Log of CustomImportFukokuAM alone attached. Actually error occurs in three of the projects CustomImportKyosuiren, CustomImportRheinland and CustomImportFukokuAM.

Build Log
Rebuild started: Project: CustomImportFukokuAM, Configuration: Release MinDependency|Win32
 Command Lines      Creating temporary file "c:\C++\Audi\CustomImportFukokuAM\ReleaseMinDependency\RSP0007AC60604136.rsp" with contents
[
/char signed /env win32 /Oicf  /tlb ".\CustomImportFukokuAM.tlb" /h "CustomImportFukokuAM.h" /iid "CustomImportFukokuAM_i.c"".\CustomImportFukokuAM.idl"
]
Creating command line "midl.exe @"c:\C++\Audi\CustomImportFukokuAM\ReleaseMinDependency\RSP0007AC60604136.rsp" /nologo"
 Output Window      Creating Type Library...
Processing .\CustomImportFukokuAM.idl
CustomImportFukokuAM.idl
Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\oaidl.idl
oaidl.idl
Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\objidl.idl
objidl.idl
Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\unknwn.idl
unknwn.idl
Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\wtypes.idl
wtypes.idl
Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\basetsd.h
basetsd.h
Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\guiddef.h
guiddef.h
Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\ocidl.idl
ocidl.idl
Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\oleidl.idl
oleidl.idl
Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\servprov.idl
servprov.idl
Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\urlmon.idl
urlmon.idl
Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\msxml.idl
msxml.idl
Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\oaidl.acf
oaidl.acf
Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\ocidl.acf
ocidl.acf
midl : error MIDL2019 : error accessing type info 
 Results      Build log was saved at "file://c:\C++\Audi\CustomImportFukokuAM\ReleaseMinDependency\BuildLog.htm"
CustomImportFukokuAM - 1 error(s), 0 warning(s)

I would request you to shed some light on the error and fix. Looking forward for help!

Thanks!

Ankush.

P.S: I've already created a thread for a similar error, But now as the poblem is little different I've created a new thread for this issue again.


Read SMART DATA from HDD

$
0
0

Hi guys,

 I m trying to read SMART attributes and print on the screen using windows API but i dont know here how to read and print in C++. I have written a small code

SENDCMDINPARAMS stCIP={0};
	SENDCMDOUTPARAMS stCOP={0};
	DWORD dwRet=0;
	BOOL bRet=FALSE;
	BYTE	szAttributes[sizeof(SENDCMDOUTPARAMS) + READ_ATTRIBUTE_BUFFER_SIZE - 1];

	stCIP.cBufferSize=0;
	stCIP.bDriveNumber = drive;
	stCIP.irDriveRegs.bFeaturesReg= 0xD0;
	stCIP.irDriveRegs.bSectorCountReg = 1;
	stCIP.irDriveRegs.bSectorNumberReg = 1;
	stCIP.irDriveRegs.bCylLowReg = 0x4F;
	stCIP.irDriveRegs.bCylHighReg = 0xC2;
	stCIP.irDriveRegs.bDriveHeadReg = 0xA0 | ((drive & 1) << 4);
	stCIP.irDriveRegs.bCommandReg = 0xB0;
	bRet=DeviceIoControl(handle,SMART_RCV_DRIVE_DATA,&stCIP,sizeof(stCIP),szAttributes,sizeof(SENDCMDOUTPARAMS)+ READ_ATTRIBUTE_BUFFER_SIZE - 1,&dwRet,NULL);
	//std::cout<<"output="<<dwRet<<std::endl;
	//printf("\n");

	USHORT *arr=(USHORT *)(((SENDCMDOUTPARAMS*)szAttributes)->bBuffer);
please help me to print attributes on screen .....
 


Sample MFC Application with CDockablePane as view?

$
0
0

Is there any example that show CDockablePane with Document / View architecture design? Most of the sample I saw are either SDI or MDI. I want to create MDI example that allow user to move the windows outside of the app, like Visual Studio 2013.

Thanks,
Steve

ActiveX bitmap push button built in VS 2013

$
0
0
I migrated an ActiveX project from VS 2008 to VS 2013 that has various controls including bitmap push button. When I build under C++ VS 2013, the control works in dialogs but is disabled in CDialogBar derived classes. I am not sure why VS 2013 build works incorrectly?

“Preview of ” in tab group

$
0
0

VS 2013 C++ sometimes opens a file with a tab at the right of the tab group instead of adding it to the open tabs at the left, and if you hover the mouse over the tab, it says “Preview of <file>” instead of just “<file>”.  If you drag the tab to the group at the left, the “Preview of” part of the hover label goes away.  What is the point of this?  Is there different functionality involved?  If not, is there a way to disable this distracting behavior?

Viewing all 15302 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>