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

.lib is niot a valid win 32 application

$
0
0

i want to run one project from the github.com in my machine, i followed the instruction and opened the solution file and tried to run the project but when i click on the local debugger following error occur

.lib is not a valid win 32 application.

i read the answer in the stack overflow and build the solution by right clicking and then clicking in the build but my question id how do i run that project now ? when i click in debugger same error shows up? i also tried including generated library after the building solution to the additional directory but that don't solve my problem either?


Compiler Warning C26486 ranged for-loop

$
0
0

So, I'm just not getting the whole lifetime thing with this code:

using D_String = Multi_String<String_Type::dictionary>;

int main()

{ std::vector<D_String> dictionary_vector = { "cat","CAT","DOG","dog","fish","Dog","" }; std::cout << "Before sort : "; for (const auto& s : dictionary_vector) std::cout << s << " "; // Highlights cout << s

For What its worth, The constructor for Multi_String looks like this:

template <String_Type ST>
class Multi_String
{
	std::string s;
public:
	Multi_String(const char* cstr) : s{ cstr } {}
	Multi_String(const std::string& s_) : s{ s_ } {}
	Multi_String(std::string&& s_) noexcept : s{ std::move(s_) } {}
	auto operator<=>(const Multi_String<ST>& rhs) const;
	bool operator==(const Multi_String<ST>& rhs) noexcept;
	const char* c_str() const noexcept;

	friend std::ostream& operator<< (std::ostream& out, const Multi_String<ST>& s);
};

Any clue as to how this warning is helping the user (me)? Are there things that I should be actually doing about this code to make the error go away (other than #pragma warning(disable:26486)?

Thanks!

text box Contents

$
0
0

hi , i need to know how to check if a textbox contains a  letter or numbers in c++ 

something like this

'''''

if( textbox contains leters ){}

if (textbox contains numbers ){}

''''' 

Clearing array

$
0
0

Hi all.

Is there a better (faster) way to zero arrays. Then using a for loop.

array<PointF>^ nose = gcnew array<PointF>(360); for (int i = 0; i < 360; i++) { nose[i]= PontF(0.,0.); }


delete [] nose;  // wont work sens they are global and need to be reused

They are also used for drawing in Picturebox

thank you

how to insert vector object into the map using C++

$
0
0

Hello All,

My requirement is to insert vector object into the map. But, when trying to insert vector object into the map getting the below error.

no instance of overloaded function "std::map<_Kty, _Ty, _Pr, _Alloc>::insert [with _Kty=std::wstring, _Ty=std::wstring, _Pr=std::less<std::wstring>, _Alloc=std::allocator<std::pair<const std::wstring, std::wstring>>]" matches the argument list

Could someone help me how to insert vector object into the map?

#include "stdafx.h"
#include <vector>
#include <iostream>
#include <map>
using namespace std;

int main()
{
std::vector<std::wstring> Locations;
std::map<std::wstring, std::wstring> m_params;

m_params.insert({ L"emailType" , L"email" });
m_params.insert({ L"emailLocation" , Locations });   //Here I am getting an error

for (auto itr = m_params.begin(); itr != m_params.end(); ++itr) 
{

}
return 0;
}

Runtime Error during execution of C# Application

$
0
0

Hi, I Have an Application developed in VC# ( visual Studio 2005) .Net runtime 2.0

Sometimes ( not always ) i get an error message in a message box saying that

 

" <application_name> has encountered a problem and needs to close. We are sorry for the inconvienience"

"if you were in the middle of something, the information you were working on might be lost"

 

with a"Debug" and "Close" button.

 

 I have not written code for a message like this and this exception is not caught in my 'try...catch' blocks.

Anyone has any idea what the cause of this problem may be?

If any more information is required , please convey.

 

regards,

Pravin

Visual Studio C++, in the pre-build event is there a way to get the list of files being compiled?

$
0
0

In the Pre-build event I'd like the list of files visual studio will compile. I'd like to run scripts just on those files. Is there a way to do this?  I don't want to check every file in the project every time I compile to see if the script needs to run on them.  I just want to run the script on the files that have changed/being compiled. Ideally I wouldn't have to detect myself which files have changed (by looking at timestamps or keeping track of a file hash).

Dynamic array in Visual Stdio IDE

$
0
0

Hello,

We cannot run the below code in Visual Studio and I have an error but in othercompilerit can be compile.

What's the difference?

#include<iostream>


int main()
{
    int n;
    cin>>n;

    int a[n];

    return 0 ;
}


How to convert IStream to Base64 string in c++

$
0
0

I have C++ IStream and I want to convert it to base 64 string in c++ so that I can use it in C++/cli to convert it to .net stream.

Similar way, I want to know how to convert base 64 string back to C++ IStream.




Load C++ DLL At Specific Range Of Address

$
0
0

I want to develop a C++ dynamic library, a DLL. It targets x64. But when the application that uses this DLL runs, I want the DLL to be loaded within range of signed 32 bit integer memory space.

How to do that?

GDI leak in old Win32 code

$
0
0

This is really very old Win32 code from Charles Petzold's "Programming Windows":

You might want to create pens on the fly and combine the CreatePen andSelectObject calls in the same statement:

SelectObject (hdc, CreatePen (PS_DASH, 0, RGB (255, 0, 0))) ;

Now when you draw lines, you'll be using a red dashed pen. When you're finished drawing the red dashed lines, you can delete the pen. Whoops! How can you delete the pen when you haven't saved the pen handle? Recall thatSelectObject returns the handle to the pen previously selected in the device context. This means that you can delete the pen by selecting the stock BLACK_PEN into the device context and deleting the value returned fromSelectObject:

DeleteObject (SelectObject (hdc, GetStockObject (BLACK_PEN))) ;

This is found to be leaking the Pen handle. Are there recent changes to do with the object created on the fly which get leaked now?

Looking for a programmatical way to push/pull certificates to AD (API or Protocols)

$
0
0
I need to push an OpenSSL Cert to AD certificate store and retrieve it programmatically to our own MDM. 
Is there any API or any protocols like LDAP or any other ways?
preferred language : C++ Java C#

Vigneshan Seshamany

Sysfer Exception thrown

$
0
0
Hello everyone,

I am trying to run a simple start up CUDA project and I get the following output, without being able to run it:
[code]TestProject.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\apphelp.dll'. Cannot find or open the PDB file.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\sysfer.dll'. Cannot find or open the PDB file.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\SHCore.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\windows.storage.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\profapi.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\powrprof.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\umpdc.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\cryptsp.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140d.dll'. Cannot find or open the PDB file.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbased.dll'. Cannot find or open the PDB file.
Exception thrown at 0x00007FFA846FA839 in TestProject.exe: Microsoft C++ exception: SysferException at memory location 0x000000E96537DA30.
Exception thrown at 0x00007FFA846FA839 in TestProject.exe: Microsoft C++ exception: SysferException at memory location 0x000000E96537DA30.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\DXCore.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\setupapi.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\bcrypt.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\devobj.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\wintrust.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\msasn1.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\crypt32.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\nvcuda.dll'. Cannot find or open the PDB file.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\version.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\nvfatbinaryLoader.dll'. Cannot find or open the PDB file.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\ws2_32.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\dwmapi.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\uxtheme.dll'. Symbols loaded.
'TestProject.exe' (Win32): Unloaded 'C:\Windows\System32\dwmapi.dll'
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\nvapi64.dll'. Cannot find or open the PDB file.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'. Symbols loaded.
'TestProject.exe' (Win32): Loaded 'C:\Windows\System32\dxgi.dll'. Symbols loaded.
'TestProject.exe' (Win32): Unloaded 'C:\Windows\System32\ole32.dll'
'TestProject.exe' (Win32): Unloaded 'C:\Windows\System32\dxgi.dll'
'TestProject.exe' (Win32): Unloaded 'C:\Windows\System32\nvapi64.dll'
'TestProject.exe' (Win32): Unloaded 'C:\Windows\System32\version.dll'
'TestProject.exe' (Win32): Unloaded 'C:\Windows\System32\ws2_32.dll'
'TestProject.exe' (Win32): Unloaded 'C:\Windows\System32\nvfatbinaryLoader.dll'
'TestProject.exe' (Win32): Unloaded 'C:\Windows\System32\nvcuda.dll'
The thread 0x2e20 has exited with code 1 (0x1).
The thread 0x378c has exited with code 1 (0x1).
The thread 0x363c has exited with code 1 (0x1).
The program '[9348] TestProject.exe' has exited with code 1 (0x1).
[/code]

Has anyone experienced this issue and how can I fix it?

Thanks

An .asm file builds successfully in VS2019, even though I have not updated Build Customization for a masm target. How is this possible?

$
0
0

This is the code:

.386
.MODEL flat, stdcall
.stack 4096

ExitProcess PROTO STDCALL, dwExitCode: DWORD

.CODE
main PROC
    mov eax, -1
    invoke ExitProcess, 0
main ENDP

END main

This the picture contained Build Customization

And this is the picture of `main.asm` property page:

To enlarge the pictures click them with the mouse right button and select "Open image in new tab"

TimeZone

$
0
0

I use this function to get the TIME_ZONE_INFORMATION for the time specified in lpLocalTime.

BOOL TzSpecificLocalTimeToSystemTime(
  const TIME_ZONE_INFORMATION *lpTimeZoneInformation,
  const SYSTEMTIME            *lpLocalTime,
  LPSYSTEMTIME                lpUniversalTime
);

typedef struct _TIME_ZONE_INFORMATION {
  LONG       Bias;
  WCHAR      StandardName[32];
  SYSTEMTIME StandardDate;
  LONG       StandardBias;
  WCHAR      DaylightName[32];
  SYSTEMTIME DaylightDate;
  LONG       DaylightBias;
} TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;

But both StandardName and DaylightName are localized according to the current user default UI language.

Is there anyway to get the source locale or translator function available to get the StandardName and DaylightName in English instead of default locale.
When my PC setup in German language, I get the _TIME_ZONE_INFORMATION standard name as
"ostliche Standarzeit" which is in german language. I want to get it as 'Eastern Standard Time'. Can anyone help me?



Why do I get the errors below when I use the /ENTRY option for the linker in a C++ project?

$
0
0

Why do I get the errors below for the following simple code in C++?

#include<iostream>
struct A{ int i; A(): i(1){ std::cout << i << '\n'; } };

A a;

int main()
{
	return 0;
}

Debug/x86 with linker options /SUBSYSTEM = Console (/SUBSYSTEM:CONSOLE) and /ENTRY = main

1>------ Build started: Project: CPP, Configuration: Debug Win32 ------
1>main.obj : error LNK2019: unresolved external symbol ___CxxFrameHandler3 referenced in function __unwindfunclet$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@D@Z$2
1>MSVCRTD.lib(init.obj) : error LNK2019: unresolved external symbol __CrtDbgReport referenced in function __CRT_RTC_INIT
1>MSVCRTD.lib(init.obj) : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function __CRT_RTC_INITW
1>MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol _strcpy_s referenced in function "void __cdecl _RTC_StackFailure(void *,char const *)" (?_RTC_StackFailure@@YAXPAXPBD@Z)
1>MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol _strcat_s referenced in function "void __cdecl _RTC_StackFailure(void *,char const *)" (?_RTC_StackFailure@@YAXPAXPBD@Z)
1>MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol ___stdio_common_vsprintf_s referenced in function __vsprintf_s_l
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __wmakepath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)" (?GetPdbDllPathFromFilePath@@YAHPB_WPA_WI@Z)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __wsplitpath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)" (?GetPdbDllPathFromFilePath@@YAHPB_WPA_WI@Z)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol _wcscpy_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)" (?GetPdbDllPathFromFilePath@@YAHPB_WPA_WI@Z)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol ___vcrt_GetModuleFileNameW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPAUHINSTANCE__@@XZ)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol ___vcrt_GetModuleHandleW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPAUHINSTANCE__@@XZ)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol ___vcrt_LoadLibraryExW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPAUHINSTANCE__@@XZ)
1>MSVCRTD.lib(chandler4_noexcept.obj) : error LNK2019: unresolved external symbol _terminate referenced in function __except_handler4_noexcept
1>MSVCRTD.lib(chandler4gs.obj) : error LNK2019: unresolved external symbol __except_handler4_common referenced in function __except_handler4
1>C:\Users\jabel\Documents\Visual Studio 2017\Projects\Assemblies\Debug\CPP.exe : fatal error LNK1120: 14 unresolved externals
1>Done building project "CPP.vcxproj" -- FAILED.

Debug/x86 with linker options /SUBSYSTEM = Not set and /ENTRY = main

1>------ Build started: Project: CPP, Configuration: Debug Win32 ------
1>main.obj : error LNK2019: unresolved external symbol ___CxxFrameHandler3 referenced in function __unwindfunclet$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@D@Z$2
1>MSVCRTD.lib(init.obj) : error LNK2019: unresolved external symbol __CrtDbgReport referenced in function __CRT_RTC_INIT
1>MSVCRTD.lib(init.obj) : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function __CRT_RTC_INITW
1>MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol _strcpy_s referenced in function "void __cdecl _RTC_StackFailure(void *,char const *)" (?_RTC_StackFailure@@YAXPAXPBD@Z)
1>MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol _strcat_s referenced in function "void __cdecl _RTC_StackFailure(void *,char const *)" (?_RTC_StackFailure@@YAXPAXPBD@Z)
1>MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol ___stdio_common_vsprintf_s referenced in function __vsprintf_s_l
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __wmakepath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)" (?GetPdbDllPathFromFilePath@@YAHPB_WPA_WI@Z)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __wsplitpath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)" (?GetPdbDllPathFromFilePath@@YAHPB_WPA_WI@Z)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol _wcscpy_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)" (?GetPdbDllPathFromFilePath@@YAHPB_WPA_WI@Z)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol ___vcrt_GetModuleFileNameW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPAUHINSTANCE__@@XZ)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol ___vcrt_GetModuleHandleW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPAUHINSTANCE__@@XZ)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol ___vcrt_LoadLibraryExW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPAUHINSTANCE__@@XZ)
1>MSVCRTD.lib(chandler4_noexcept.obj) : error LNK2019: unresolved external symbol _terminate referenced in function __except_handler4_noexcept
1>MSVCRTD.lib(chandler4gs.obj) : error LNK2019: unresolved external symbol __except_handler4_common referenced in function __except_handler4
1>C:\Users\jabel\Documents\Visual Studio 2017\Projects\Assemblies\Debug\CPP.exe : fatal error LNK1120: 14 unresolved externals
1>Done building project "CPP.vcxproj" -- FAILED.

Debug/x64 with linker options /SUBSYSTEM = Console (/SUBSYSTEM:CONSOLE) and /ENTRY = main

1>------ Build started: Project: CPP, Configuration: Debug x64 ------
1>main.obj : error LNK2001: unresolved external symbol __CxxFrameHandler3
1>MSVCRTD.lib(gshandlereh.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler3
1>MSVCRTD.lib(init.obj) : error LNK2019: unresolved external symbol _CrtDbgReport referenced in function _CRT_RTC_INIT
1>MSVCRTD.lib(init.obj) : error LNK2019: unresolved external symbol _CrtDbgReportW referenced in function _CRT_RTC_INITW
1>MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol strcpy_s referenced in function "void __cdecl _RTC_StackFailure(void *,char const *)" (?_RTC_StackFailure@@YAXPEAXPEBD@Z)
1>MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol strcat_s referenced in function "void __cdecl _RTC_StackFailure(void *,char const *)" (?_RTC_StackFailure@@YAXPEAXPEBD@Z)
1>MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol __stdio_common_vsprintf_s referenced in function _vsprintf_s_l
1>MSVCRTD.lib(error.obj) : error LNK2001: unresolved external symbol __C_specific_handler_noexcept
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol _wmakepath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned __int64)" (?GetPdbDllPathFromFilePath@@YAHPEB_WPEA_W_K@Z)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol _wsplitpath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned __int64)" (?GetPdbDllPathFromFilePath@@YAHPEB_WPEA_W_K@Z)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol wcscpy_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned __int64)" (?GetPdbDllPathFromFilePath@@YAHPEB_WPEA_W_K@Z)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __vcrt_GetModuleFileNameW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPEAUHINSTANCE__@@XZ)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __vcrt_GetModuleHandleW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPEAUHINSTANCE__@@XZ)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __vcrt_LoadLibraryExW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPEAUHINSTANCE__@@XZ)
1>C:\Users\jabel\Documents\Visual Studio 2017\Projects\Assemblies\x64\Debug\CPP.exe : fatal error LNK1120: 13 unresolved externals
1>Done building project "CPP.vcxproj" -- FAILED.

Debug/x64 with linker options /SUBSYSTEM = Not set and /ENTRY = main

1>main.obj : error LNK2001: unresolved external symbol __CxxFrameHandler3
1>MSVCRTD.lib(gshandlereh.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler3
1>MSVCRTD.lib(init.obj) : error LNK2019: unresolved external symbol _CrtDbgReport referenced in function _CRT_RTC_INIT
1>MSVCRTD.lib(init.obj) : error LNK2019: unresolved external symbol _CrtDbgReportW referenced in function _CRT_RTC_INITW
1>MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol strcpy_s referenced in function "void __cdecl _RTC_StackFailure(void *,char const *)" (?_RTC_StackFailure@@YAXPEAXPEBD@Z)
1>MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol strcat_s referenced in function "void __cdecl _RTC_StackFailure(void *,char const *)" (?_RTC_StackFailure@@YAXPEAXPEBD@Z)
1>MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol __stdio_common_vsprintf_s referenced in function _vsprintf_s_l
1>MSVCRTD.lib(error.obj) : error LNK2001: unresolved external symbol __C_specific_handler_noexcept
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol _wmakepath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned __int64)" (?GetPdbDllPathFromFilePath@@YAHPEB_WPEA_W_K@Z)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol _wsplitpath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned __int64)" (?GetPdbDllPathFromFilePath@@YAHPEB_WPEA_W_K@Z)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol wcscpy_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned __int64)" (?GetPdbDllPathFromFilePath@@YAHPEB_WPEA_W_K@Z)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __vcrt_GetModuleFileNameW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPEAUHINSTANCE__@@XZ)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __vcrt_GetModuleHandleW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPEAUHINSTANCE__@@XZ)
1>MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __vcrt_LoadLibraryExW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPEAUHINSTANCE__@@XZ)
1>C:\Users\jabel\Documents\Visual Studio 2017\Projects\Assemblies\x64\Debug\CPP.exe : fatal error LNK1120: 13 unresolved externals
1>Done building project "CPP.vcxproj" -- FAILED.
 

For the other combinations where the /ENTRY option is not specified the code compiles, links and executes normally for both x86 and x64. I have the feeling that this is a bug in VS2017 version 15.9.7, but I would appreciate some confirmation on this.

I know that the user doesn't need to specify the /ENTRY option in a C++ program, as the compiler already requires the name main for the function to be invoked by the C run-time library (see [basic.start] in the C++ standard). Nevertheless, I would say that the code should compile when the user provides a correct name for this /ENTRY option.

How to draw text around circle?

How to restart Explorer as a pre-build event in Visual Studio

$
0
0
I'd like to restart Explorer when building my DLL in Visual Studio. I've tried adding taskkill /f /IM explorer.exe and start explorer as pre-build events in the project configuration. When I then build my project, Explorer will in fact be terminated, but it will not be successfully restarted. The taskbar will remain missing. Only after starting explorer from a command prompt will it return. I've also tried executing a call to those commands in a .bat file, but I get the same problem (although the .bat file works properly when executed on its own, outside Visual Studio). I've also tried putting the relaunch part in a post-build event, but no dice. Is there any trick to getting Explorer to relaunch successfully in a pre-build event? Thanks for any input.

The SendInput()/SetCursorPos() API is not working in a remote session, if the mouse cursor is made hidden

$
0
0
  •          The  SendInput()/SetCursorPos() API is not working in a remote session, if themouse cursor is hidden.
  •           So in this situation, whenSendInput()/SetCursorPos() API is called after the cursor is madehidden, the client machine’s mouse position is not changed. But the value ofGetCursorPos() returns the point to where the mouse cursor is re-positioned using any of these API's
  •         If themouse cursor is not made hidden in a remote session, the SendInput()/SetCursorPos() API works as expected.

Can anyone help to solve this situation?


Getting server crash by a VC++ Dll(Written in MFC programming of VC ++) in web archive(war)when application server(JbossEAP) is running from windows services while same works absolutely fine by running server from bat file.

$
0
0

Environment: - 

Operating System: Windows 10

Dll Written: VS 2008

Dll Used By: - A war (web archive) file written in J2EE and call dll by native keyword

Application Server: - Jboss EAP 7.1 and it can start from both .bat file or windows service

Description: -

We have a web application program which is deploying on an application server: Jboss EAP and on a web page, we are calling Dll method by native keyword. This Dll is written in MFC programming of VC ++ for achieving and replace some string in word template and it is working fine when server is running from bat file.

When JbossEAP server is running from services (Windows Service), server is getting crashed. And the line where server is getting crashed, it is inside the Dll, i.e. Dll code is calling, but something is missing and due to that program is terminating jvm and server crashed.

Code snippet where program is crashing: -

_Application oAppObj;

_Document oActDoc ;

if(!oAppObj.CreateDispatch(_T("Word.Application"),&e))

{

           _stprintf(buf, _T("Error on CreateDispatch() : %ld (%08lx)"),e.m_sc, e.m_sc);

           Log(WDPROJ_CANNOT_OPEN_WORD,_T(""),_T(""),_T("Cannot open the word object."));

           return WDPROJ_CANNOT_OPEN_WORD;

}

oAppObj.m_bAutoRelease = true;

Documents oDocs = oAppObj.GetDocuments();

Log(0, _T("OPENING_WORD_DOCUMENT"), _T("PROCESSING"), _T(""));          

// Server crashed on below highlighted line

oActDoc=oDocs.Open(COleVariant(strTmpFileName),covOptional,covOptional,covOptional,covOptional,covOptional,covOptional,covOptional,covOptional,covOptional,covOptional,covOptional);

oDocs.m_bAutoRelease =true;

Log(0,_T("OPEN_WORD_DOCUMENT_TASK"),_T("COMPLETED"),_T(""));

 

Error captured in Event viewer logs when server crashed: -

Event Logs: -

Faulting application name: java.exe, version: 8.0.1810.13, time stamp: 0x5b40a072

Faulting module name: MSVCR90.dll, version: 9.0.30729.9247, time stamp: 0x56fa3839

Exception code: 0xc0000417

Fault offset: 0x00000000000552d4

Faulting process id: 0x1114

Faulting application start time: 0x01d5a5cf78a953f3

Faulting application path: C:\Program Files\Java\jdk1.8.0_181\bin\java.exe

Faulting module path: C:\windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9247_none_08e394a1a83e212f\MSVCR90.dll

Report Id: 2ce9dd98-718b-4f41-8405-85c7ff940116

Faulting package full name:

Faulting package-relative application ID:

Kindly assist me to resolve the issue. I will be really thankful.



Regards, S.P Singh


Viewing all 15302 articles
Browse latest View live


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