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

c++ rest sdk : compilation error with a progress_handler,VS2013 Pro update5

$
0
0

Hi,

if I do :

std::function< void(message_direction::direction, utility::size64_t)> f = &COCom::progress;

//or
//progress_handler f = &COCom::progress;

requete.set_progress_handler(f);

in one method of COCom, I have the following compilation error :

1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\functional(506): error C2664: 'void std::_Func_class<_Ret,web::http::message_direction::direction,utility::size64_t>::_Set(std::_Func_base<_Ret,web::http::message_direction::direction,utility::size64_t> *)' : cannot convert argument 1 from '_Myimpl *' to 'std::_Func_base<_Ret,web::http::message_direction::direction,utility::size64_t> *'
1>          with
1>          [
1>              _Ret=void
1>          ]
1>          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\functional(442) : see reference to function template instantiation 'void std::_Func_class<_Ret,web::http::message_direction::direction,utility::size64_t>::_Do_alloc<_Myimpl,_Fret(__cdecl COCom::* const &)(web::http::message_direction::direction,utility::size64_t),_Alloc>(_Fty,_Alloc)' being compiled
1>          with
1>          [
1>              _Ret=void
1>  ,            _Fret=void
1>  ,            _Alloc=std::allocator<std::_Func_class<void,web::http::message_direction::direction,utility::size64_t>>
1>  ,            _Fty=void (__cdecl COCom::* const &)(web::http::message_direction::direction,utility::size64_t)
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\functional(442) : see reference to function template instantiation 'void std::_Func_class<_Ret,web::http::message_direction::direction,utility::size64_t>::_Do_alloc<_Myimpl,_Fret(__cdecl COCom::* const &)(web::http::message_direction::direction,utility::size64_t),_Alloc>(_Fty,_Alloc)' being compiled
1>          with
1>          [
1>              _Ret=void
1>  ,            _Fret=void
1>  ,            _Alloc=std::allocator<std::_Func_class<void,web::http::message_direction::direction,utility::size64_t>>
1>  ,            _Fty=void (__cdecl COCom::* const &)(web::http::message_direction::direction,utility::size64_t)
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\functional(442) : see reference to function template instantiation 'void std::_Func_class<_Ret,web::http::message_direction::direction,utility::size64_t>::_Reset_alloc<_Fret,COCom,web::http::message_direction::direction,utility::size64_t,std::allocator<std::_Func_class<_Ret,web::http::message_direction::direction,utility::size64_t>>>(_Fret (__cdecl COCom::* const )(web::http::message_direction::direction,utility::size64_t),_Alloc)' being compiled
1>          with
1>          [
1>              _Ret=void
1>  ,            _Fret=void
1>  ,            _Alloc=std::allocator<std::_Func_class<void,web::http::message_direction::direction,utility::size64_t>>
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\functional(442) : see reference to function template instantiation 'void std::_Func_class<_Ret,web::http::message_direction::direction,utility::size64_t>::_Reset_alloc<_Fret,COCom,web::http::message_direction::direction,utility::size64_t,std::allocator<std::_Func_class<_Ret,web::http::message_direction::direction,utility::size64_t>>>(_Fret (__cdecl COCom::* const )(web::http::message_direction::direction,utility::size64_t),_Alloc)' being compiled
1>          with
1>          [
1>              _Ret=void
1>  ,            _Fret=void
1>  ,            _Alloc=std::allocator<std::_Func_class<void,web::http::message_direction::direction,utility::size64_t>>
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\functional(671) : see reference to function template instantiation 'void std::_Func_class<_Ret,web::http::message_direction::direction,utility::size64_t>::_Reset<void,COCom,web::http::message_direction::direction,utility::size64_t>(_Fret (__cdecl COCom::* const )(web::http::message_direction::direction,utility::size64_t))' being compiled
1>          with
1>          [
1>              _Ret=void
1>  ,            _Fret=void
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\functional(671) : see reference to function template instantiation 'void std::_Func_class<_Ret,web::http::message_direction::direction,utility::size64_t>::_Reset<void,COCom,web::http::message_direction::direction,utility::size64_t>(_Fret (__cdecl COCom::* const )(web::http::message_direction::direction,utility::size64_t))' being compiled
1>          with
1>          [
1>              _Ret=void
1>  ,            _Fret=void
1>          ]
1>          OCom.cpp(486) : see reference to function template instantiation 'std::function<void (web::http::message_direction::direction,utility::size64_t)>::function<void(__cdecl COCom::* )(web::http::message_direction::direction,utility::size64_t)>(_Fx&&)' being compiled
1>          with
1>          [
1>              _Fx=void (__cdecl COCom::* )(web::http::message_direction::direction,utility::size64_t)
1>          ]
1>          OCom.cpp(486) : see reference to function template instantiation 'std::function<void (web::http::message_direction::direction,utility::size64_t)>::function<void(__cdecl COCom::* )(web::http::message_direction::direction,utility::size64_t)>(_Fx&&)' being compiled
1>          with
1>          [
1>              _Fx=void (__cdecl COCom::* )(web::http::message_direction::direction,utility::size64_t)
1>          ]

with visual studio 2013 update 5.

we have : typedef std::function< void(message_direction::direction, utility::size64_t)> progress_handler;

in the rest sdk, and void set_progress_handler(const progress_handler &handler) is a method of http_request.

the signature of  progress is void COCom::progress(direction dir, utility::size64_t s)...

I have read the following :

// store a call to a member function
    std::function<void(const Foo&, int)> f_add_display =&Foo::print_add;
    Foo foo(314159);
    f_add_display(foo, 1);

so I don't understand why I cannot compile...

has someone an idea ?

regards.




-Embedding in COM server process Command Line

$
0
0

Hi All

I have a out-proc COM server ABC.exe and that is started by a DEF.exe module. Now I have modified DEF.exe with new windows CRT (msvcr100.dll) and then, when I run DEF.exe, then ABC.exe component also get started but in Command line column in task manager it is showing as following

  C:\..\..\ABC.exe -Embedding

My concern is why this -Embedding is coming because earlier it was not showing that switch. Is it normal or some problem? I am not able to figure out the issue. Please help me out to resolve this -Embedding switch.

Thanks and Regards

Rahul

C++ rest sdk : reading a stream(or streambuf) and writing into a producer_consumer buffer (memory)

$
0
0

Hi,
I have a basic_istream(fileStream1) which I get from a file_stream.I have a loop where I read this stream and write it into a producer_consumer buffer(pcb) :

pcb.set_buffer_size(10485760, std::ios_base::out);//10mb
 size_t count = 10485760;//10 mb
        while (sizef2>0)
        {
            nread=fileStream1.read(pcb, count).get();
            sizef2 -= nread;
        }

If fileSTream1 comes from a big file that code takes so much memory as the size of the file .

Is it possible to use less memory using alloc, acquire,release (method of a streambuf) ? I didn't find examples and how to use these methods . has someone experience with these methods ?

regards

C++ code equivalent of sample C# code

$
0
0

Can anybody make C++ code eqivalent of following C# code?

    class Plus
    {
        private int x;
        private int y;
        public int X
        {
            get { return x; }
            set { x = value; }
        }
        public int Y
        {
            get { return y; }
            set { y = value; }
        }
        public int plus()
        {
            return (x + y);
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Plus p = new Plus();
            p.X = 1;
            p.Y = 2;
            Console.WriteLine("result : {0} ", p.plus());
        }
    }

This C# code is not useful program but I'd like to brush up on C++ here.


C++ Direct x windows 8.1 app, v2013, Can someone take a look at this project, getting linker errors, I've tried everything to fix this?

$
0
0

Basically code is from previous project my tutor helped me develop unfortunately I can no longer contact him, but I'm working on similar project which I did a simple object that moves around on screen, I pasted a pre-existing Direct X tool kit that my teacher gave me and imported it in as a project and did the linker with my other project but it's giving me the linker errors. Please kindly fix this there's no coding errors, also if possible please explain with screenshots what was wrong so I would remember for next time, thank you. Edit: I've already right clicked on my P2BallGame and went on properties and linker and matched it with my previous project seen as they use the same direct x tool kit folder.

http://www.megafileupload.com/9c1m/P2BallGamev2.zip

1>------ Build started: Project: P2BallGame, Configuration: Debug Win32 ------1>SpriteResources.obj : error LNK2019: unresolved external symbol "public: __thiscall DirectX::SpriteBatch::SpriteBatch(struct ID3D11DeviceContext *)" (??0SpriteBatch@DirectX@@QAE@PAUID3D11DeviceContext@@@Z) referenced in function "public: __thiscall P2BallGame::SpriteResources::SpriteResources(class std::shared_ptr<class DX::DeviceResources>)" (??0SpriteResources@P2BallGame@@QAE@V?$shared_ptr@VDeviceResources@DX@@@std@@@Z)1>PlayerBall.obj : error LNK2001: unresolved external symbol "public: __thiscall DirectX::SpriteBatch::SpriteBatch(struct ID3D11DeviceContext *)" (??0SpriteBatch@DirectX@@QAE@PAUID3D11DeviceContext@@@Z)1>SpriteResources.obj : error LNK2019: unresolved external symbol "public: __thiscall DirectX::CommonStates::CommonStates(struct ID3D11Device *)" (??0CommonStates@DirectX@@QAE@PAUID3D11Device@@@Z) referenced in function "public: __thiscall P2BallGame::SpriteResources::SpriteResources(class std::shared_ptr<class DX::DeviceResources>)" (??0SpriteResources@P2BallGame@@QAE@V?$shared_ptr@VDeviceResources@DX@@@std@@@Z)1>PlayerBall.obj : error LNK2001: unresolved external symbol "public: __thiscall DirectX::CommonStates::CommonStates(struct ID3D11Device *)" (??0CommonStates@DirectX@@QAE@PAUID3D11Device@@@Z)1>SpriteResources.obj : error LNK2019: unresolved external symbol "public: __thiscall DirectX::SpriteFont::SpriteFont(struct ID3D11Device *,wchar_t const *)" (??0SpriteFont@DirectX@@QAE@PAUID3D11Device@@PB_W@Z) referenced in function "public: __thiscall P2BallGame::SpriteResources::SpriteResources(class std::shared_ptr<class DX::DeviceResources>)" (??0SpriteResources@P2BallGame@@QAE@V?$shared_ptr@VDeviceResources@DX@@@std@@@Z)1>SpriteResources.obj : error LNK2019: unresolved external symbol "long __cdecl DirectX::CreateWICTextureFromFile(struct ID3D11Device *,struct ID3D11DeviceContext *,wchar_t const *,struct ID3D11Resource * *,struct ID3D11ShaderResourceView * *,unsigned int)" (?CreateWICTextureFromFile@DirectX@@YAJPAUID3D11Device@@PAUID3D11DeviceContext@@PB_WPAPAUID3D11Resource@@PAPAUID3D11ShaderResourceView@@I@Z) referenced in function "public: void __thiscall P2BallGame::SpriteResources::LoadTexture(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >)" (?LoadTexture@SpriteResources@P2BallGame@@QAEXV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z)1>PlayerBall.obj : error LNK2001: unresolved external symbol "long __cdecl DirectX::CreateWICTextureFromFile(struct ID3D11Device *,struct ID3D11DeviceContext *,wchar_t const *,struct ID3D11Resource * *,struct ID3D11ShaderResourceView * *,unsigned int)" (?CreateWICTextureFromFile@DirectX@@YAJPAUID3D11Device@@PAUID3D11DeviceContext@@PB_WPAPAUID3D11Resource@@PAPAUID3D11ShaderResourceView@@I@Z)1>PlayerBall.obj : error LNK2019: unresolved external symbol "public: void __vectorcall DirectX::SpriteBatch::Begin(enum DirectX::SpriteSortMode,struct ID3D11BlendState *,struct ID3D11SamplerState *,struct ID3D11DepthStencilState *,struct ID3D11RasterizerState *,class std::function<void __cdecl(void)>,struct DirectX::XMMATRIX)" (?Begin@SpriteBatch@DirectX@@QAQXW4SpriteSortMode@2@PAUID3D11BlendState@@PAUID3D11SamplerState@@PAUID3D11DepthStencilState@@PAUID3D11RasterizerState@@V?$function@$$A6AXXZ@std@@UXMMATRIX@2@@Z) referenced in function "public: void __thiscall P2BallGame::PlayerBall::Render(void)" (?Render@PlayerBall@P2BallGame@@QAEXXZ)1>P2BallGameMain.obj : error LNK2001: unresolved external symbol "public: void __vectorcall DirectX::SpriteBatch::Begin(enum DirectX::SpriteSortMode,struct ID3D11BlendState *,struct ID3D11SamplerState *,struct ID3D11DepthStencilState *,struct ID3D11RasterizerState *,class std::function<void __cdecl(void)>,struct DirectX::XMMATRIX)" (?Begin@SpriteBatch@DirectX@@QAQXW4SpriteSortMode@2@PAUID3D11BlendState@@PAUID3D11SamplerState@@PAUID3D11DepthStencilState@@PAUID3D11RasterizerState@@V?$function@$$A6AXXZ@std@@UXMMATRIX@2@@Z)1>PlayerBall.obj : error LNK2019: unresolved external symbol "public: void __thiscall DirectX::SpriteBatch::End(void)" (?End@SpriteBatch@DirectX@@QAEXXZ) referenced in function "public: void __thiscall P2BallGame::PlayerBall::Render(void)" (?Render@PlayerBall@P2BallGame@@QAEXXZ)1>P2BallGameMain.obj : error LNK2001: unresolved external symbol "public: void __thiscall DirectX::SpriteBatch::End(void)" (?End@SpriteBatch@DirectX@@QAEXXZ)1>PlayerBall.obj : error LNK2019: unresolved external symbol "public: void __vectorcall DirectX::SpriteBatch::Draw(struct ID3D11ShaderResourceView *,struct DirectX::XMFLOAT2 const &,struct tagRECT const *,union __m128,float,struct DirectX::XMFLOAT2 const &,float,enum DirectX::SpriteEffects,float)" (?Draw@SpriteBatch@DirectX@@QAQXPAUID3D11ShaderResourceView@@ABUXMFLOAT2@2@PBUtagRECT@@T__m128@@M1MW4SpriteEffects@2@M@Z) referenced in function "public: void __thiscall P2BallGame::PlayerBall::Render(void)" (?Render@PlayerBall@P2BallGame@@QAEXXZ)1>PlayerBall.obj : error LNK2019: unresolved external symbol "public: struct ID3D11BlendState * __thiscall DirectX::CommonStates::NonPremultiplied(void)const " (?NonPremultiplied@CommonStates@DirectX@@QBEPAUID3D11BlendState@@XZ) referenced in function "public: void __thiscall P2BallGame::PlayerBall::Render(void)" (?Render@PlayerBall@P2BallGame@@QAEXXZ)1>P2BallGameMain.obj : error LNK2001: unresolved external symbol "public: struct ID3D11BlendState * __thiscall DirectX::CommonStates::NonPremultiplied(void)const " (?NonPremultiplied@CommonStates@DirectX@@QBEPAUID3D11BlendState@@XZ)1>PlayerBall.obj : error LNK2001: unresolved external symbol "private: static struct DirectX::XMMATRIX const DirectX::SpriteBatch::MatrixIdentity" (?MatrixIdentity@SpriteBatch@DirectX@@0UXMMATRIX@2@B)1>P2BallGameMain.obj : error LNK2001: unresolved external symbol "private: static struct DirectX::XMMATRIX const DirectX::SpriteBatch::MatrixIdentity" (?MatrixIdentity@SpriteBatch@DirectX@@0UXMMATRIX@2@B)1>P2BallGameMain.obj : error LNK2019: unresolved external symbol "public: void __vectorcall DirectX::SpriteFont::DrawString(class DirectX::SpriteBatch *,wchar_t const *,struct DirectX::XMFLOAT2 const &,union __m128,float,struct DirectX::XMFLOAT2 const &,float,enum DirectX::SpriteEffects,float)" (?DrawString@SpriteFont@DirectX@@QAQXPAVSpriteBatch@2@PB_WABUXMFLOAT2@2@T__m128@@M2MW4SpriteEffects@2@M@Z) referenced in function "public: bool __thiscall P2BallGame::P2BallGameMain::Render(void)" (?Render@P2BallGameMain@P2BallGame@@QAE_NXZ)1>P2BallGameMain.obj : error LNK2001: unresolved external symbol "private: static struct DirectX::XMFLOAT2 const DirectX::SpriteFont::Float2Zero" (?Float2Zero@SpriteFont@DirectX@@0UXMFLOAT2@2@B)1>C:\Users\pedram\Documents\C++Menu\P2BallGame\Debug\P2BallGame\P2BallGame.exe : fatal error LNK1120: 11 unresolved externals========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==================== Deploy: 0 succeeded, 0 failed, 0 skipped =========





HEAP Error in standard winapi function call

$
0
0

Any ideas why this function compiles fine but generates a heap error when I try to run it?

std::string curdir()
{
     DWORD cdsz=MAX_PATH;
     char cd[MAX_PATH + 1];
     GetCurrentDirectory(cdsz,(LPWSTR)cd);
     cd[MAX_PATH+1]='\0';
     std::string stxt=cd;
     return stxt;
}

How can I turn off special characters that appears automatically?

$
0
0

I am a newbe who started to study C++ and just installed visual studios few days ago,

And I found that it provides a convenient function to show special characters automatically that I am supposed to type.

For example, it shows character '>' just right after I type '#include<'.

Yes, I was about to type '#include<iostream>'

So what I'm saying is this is very convenient and good function but it may not be so helpful for some people who just started studying programming just like me.

Please tell me how to turn this function off.

Thanks.


[C/win32] compilation DLL VS 2015 vs Code::blocks

$
0
0

Hi every body,

I have a big problem. here a test code of Dll :

main.h

#pragma once

#define BUILD_DLL

#ifdef BUILD_DLL
#define DLL_EXPORT __declspec(dllexport)
#else
#define DLL_EXPORT __declspec(dllimport)
#endif


#ifdef __cplusplus
extern "C"
{
#endif

	BOOL DLL_EXPORT Exe(int i);


#ifdef __cplusplus
}
#endif

Dll.cpp :

// dllmain.cpp : Defines the entry point for the DLL application.
#include <Windows.h>

#include "main.h"


BOOL DLL_EXPORT Exe(int i){

	int a = i;

	return TRUE;
}


BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
					 )
{
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		break;
	}
	return TRUE;
}

And the application code looks like this :

#include <Windows.h>
#include <stdio.h>


int main(int argc, char* argv[])
{

	HMODULE hmodule;

	hmodule = LoadLibraryEx("Dll.dll", NULL, 0);

	if (hmodule == NULL)
	{
		printf("Fail : %d", GetLastError());
	}
	else
		printf("Loaded");

	int i;
	scanf("%d", &i);

	return 0;
}

Here is the problem :

I compile this dll code under VS 2015 community with the following parameter to avoid some dependency files :

- no precompiled header
- Multi thread Dll
- Multi bytes char set
- Use standard windows library
- platform toolset : Visual Studio 2015 - Windows XP (v140_xp)

After the compilation i test the application :

under windows 8.1 : Ok, i have the loaded message :)

under windows 10 : KO , error 126 (no module found)

I take exactly the same code. I compile this with Code::Blocks (GCC) witht the default parameters for a DLL project :

windows 8.1 : OK, loaded message

windows 10 : OK, loaded message 

... the same code. So i'm looking for a compilation option to modify somewhere , but i found nothing until now.

Any ideas ?

Thanks by advance and sorry for my bad english :)



UIState

$
0
0

Hi

My problem is, that when I open my dialog (non-modal) and press the tab-key, then I only sometimes see, that a WM_CHANGEUISTATE is generated. This seems to be very random to me. On my dialog, I've only custom made controls. But they all return DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON when getting a WM_GETDLGCODE.

I see that the WM_CHANGEUISTATE is generated by the IsDialogMessage when it handles the WM_KEYDOWN for the VK_TAB. My only problem is the randomness of this...

Now, what do I mean with "random"? -> sometimes I press tab once and I get the message... sometimes 10 times until it reacts and sometimes more than 100 times...

Can someone explain me why this is?

Rudolf

MSBuild running from Local System

$
0
0
Hi

I've been executing msbuild.exe from the NT_AUTHORITY\SYSTEM account to build VS 2005 C# projects and the builds have been working as expected. Recently, I attempted the same for a VS 2004 C++ project and the build failed with the following error.

fatal error C1902: 
Program database manager mismatch;
please check your installation
Is this a bug with msbuild or am I doing something wrong?

Thanks


ANSI file handling in 64-bit Windows with C++

$
0
0

In trying to create ANSI file handling functions in 64-bit I've run across some problems...

I don['t have any problems opening a file:

HANDLE openbinaryfile(std::string namefile)
{
     std::wstring wpath=strtowstr(namefile);
     DWORD daccess=GENERIC_READ | GENERIC_WRITE;
     return CreateFile(wpath.c_str(),daccess,0,NULL,CREATE_NEW,FILE_ATTRIBUTE_NORMAL,NULL);
}

But positioning to a byte position seems to be an issue,

BOOL seek(HANDLE hfile,LONG bytepos)
{
     return SetFilePointer(hfile,bytepos,NULL,FILE_BEGIN);
}

and so does reading a specific number of bytes from that location:

std::string get$(HANDLE hfile,DWORD numbytes)
{
     DWORD bytesread;
     LPBYTE lpb=new BYTE[numbytes];
     ReadFile(hfile,lpb,numbytes,&bytesread,NULL);
     std::string b=lpb;
     return b;
}

Any ideas?

LNK1104: cannot open file 'XXX.map'

$
0
0

Hi,everone:

     I am trying to compile a c++ project with vs2010 and the LINK : fatal error LNK1104: cannot open file 'E:\...\XXX.map' shows up. and it's successful when i compile it anagin without clean. how do i get around this,THX!

How do I execute an application linked to 2 different versions of MFC?

$
0
0

Hello,

I have created an application that builds a DLL along with an EXE that references several delivered runtime DLL's. The built DLL and EXE have been built with VS2012, and the delivered runtime DLL have been built with VS2010. When I attempt to execute the application, I will receive an access violation in WinMain (the call to AfxGetThread returns NULL). Just to verify the application, if the delivered runtime DLLs were also built with VS2012, the application executes successfully.

My goal is the execute the application without relinking it.

Is there a way to utilize a manifest config file, using and to change the references to VS2010 (made by the runtime DLLs) to VS2012 so that the application can be executed without relinking?

Here is the config file that I created, but was not successful:

<configuration><windows><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" ><dependentAssembly><assemblyIdentity type="win32" name="Microsoft.VC100.MFC" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" /><bindingRedirect oldVersion="10.0.40219.325" newVersion="11.0.60610.1" /><assemblyIdentity type="win32" name="Microsoft.VC100.CRT" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" /><bindingRedirect oldVersion="10.0.40219.325" newVersion="11.0.51106.1" /></dependentAssembly></assemblyBinding></windows></configuration>

I am not sure if assembly names Microsoft.VS100.MFC and Microsoft.VS100.CRT are actually valid, and also not sure if I can redirect between major VS releases.

I have not been able to find any working examples. Any assistance would be helpful.

Regards, Rob

How can I get the full list of encodings on Visual Studio 2013 ?

$
0
0

After upgrading to Windows 10, VS2013 no longer shows the full list of encodings on the "Advanced save options" dialog on the "File" menu.

I need the UTF-8 encoding without signature (to keep accented characters in strings on source code).
It is a Windows 10 bug or there is some fix for that ?

 

Replace GDI with Layered Windows

$
0
0

We use both GDI and OpenGL in our MFC based application. 

I am now looking for an article about using "Layered Window" for the purpose of replacing the GDI completely.

Thank you.

Makoto


Using SysAllocString to copy a BSTR variable leads to the value of other BSTR variable being modified

$
0
0

I'm developing a C++ application that uses some COM interfaces which needs BSTR variable. And I define an array of BSTR variables. When I use SysAllocString method to copy the first element of the array to a new BSTR variable, the value of the second element is also modified. I have captured 2 images when debugging it. 

[http://img.bbs.csdn.net/upload/201508/21/1440158191_355395.jpg]

The first one is at the moment before invoking SysAllocString  method.

[http://img.bbs.csdn.net/upload/201508/21/1440158278_443213.jpg]

the second image is captured after invoking the method, it seems that when copying the first element, the memory space of the second element is allocated to the new BSTR variable, so the value of second element will be changed to the first one. I'm quite confused about it. How can I solve this problem

Socket Programming in VC++

$
0
0
I have basic knowledge of C++. I searched a lot about socket programming in C++. But did not get a right guide to learn this amazing thing. I desperately want to learn this. I also asked  peoples about this in Quora but not got an answer. There are some people who uploaded tutorials in Youtube. They were mostly using VC++. But some of them were using another tools. I dont have an idea about which would be the best compiler/tool to socket programming by a beginner. I learned C++ in Turbo C++. I think Turbo C++ is not much better option than VCs  to learn. If VC++ is then best plateform then which version it would be? Only from your team I could seek a good help. Is there any book or reference which you could suggest me. I would be grateful for a prompt reply. 

New to Socket Programming in VC++

$
0
0

I am new to socket programming in VC++. (I have previous application development exp. in vc++ & c#.net).

Can anybody suggest a good book or a good way to start in socket programming in vc++ ?

Regards,

kumar

How Do I Create a Windows Forms Application using Visual C++, THE FREEBIE EDITION?

$
0
0

Hi, I am new to Windows Programming in C++. (I've had courses in C and C++ in DOS console applications many years ago, but not for Windows.) I want to create a Windows program and be able to have it call other windows, etc. All the bells and whistles, but I don't know how to write the code. This version of Visual C++ doesn't seem to have a n option to produce a windows form in a box to which I would then add code objects. The code objects would then appear with their various properties in the code itself, and say, (crudely put) in "button push down", I would write the code.  What is going on?  I thought Visual C++ was getting EASIER to use, not harder.  I appears I have to PROGRAMMATICALLY produce windows with this version of the compiler, and, quite simply, I'm not there yet.  What should I do?  (I hate to resort to another language, because I'd like to learn C++ for Windows.)  Any assistance would be helpful.  (The new "FREEBIE" visual studio seems to offer only C#, and that tends to be used for web based applications, if what I see on the screen tells me anything.)

MFC Application inactive after move

$
0
0

I used the MFC Application Wizard to create an SDI application.  I tried many different options; and I think the problem occurs  when I use the ribbon.  The easiest way to is to leave all options on default except for the "user interface features" page where you must choose "Use a ribbon"

The problem I experience is tricky to reproduce.  It goes something like this: Launch the application produced by the wizard.  Now move the window by dragging the title bar using small swipe gestures with the mouse.  Sometimes it also happens when maximise and restore is done a few times. 

At some point, the window stays transparent and seems to become inactive. 

Please help -- I would really like to use a ribbon in my MFC application.



Viewing all 15302 articles
Browse latest View live


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