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

Hard Disk Serial Number

$
0
0
Hey , 

I have a question which I really hope someone can help me.
I have been dealing for a long time with finding a real unique ID for Hard Disks (slaves).
From all the forums and articles the answer I got is "Serial Number".
Is that true ? Is serial number is the only and best unique ID to recognize HD ? 
The reason I'm asking that question is that I wrote a program in c++.One of the things it does is 
getting with WMI command the HDs' serial numbers that connect to the station. 
Through the time I noticed that sometimes I get for the same HD different serial numbers or 
similar serial number but the characters changed their place.

Are you familiar with this problem ? Is there better unique ID should I use ? Is there a better call than WMI ? 

Thanks !   

eden


Could Not Disable Mouse Right Click

$
0
0

Global DisableRButton as Boolean 
Global oldwndproc as LongPtr

WndProc(Byval lhwnd as LongPtr,Byval Msg as Long,Byval wParam as LongPtr,Byval lparam as LongPtr) as Long

if DisableRButton and ((wParam=WM_RBUTTONDOWN) or (wParam=WM_RBUTTONUP)) then 
WndProc = HC_SKIP 

End If 

Wndproc=CallWindowProcA(lhwnd,Msg,wparam,lparam)

End Function

In Above Code HC_SKIP Is Right ? It Does Not Work To Disable RBUTTONDOWN 

if i write : wndproc=false also will lock the form i think 

Form_Load 

DisableRButton=True

Oldwndproc=SetWindowLongPtrA(Me.hwnd,GWL_WNDPROC,AddressOf WndPro)

Form_Unload 

SetWindowLongPtrA Me.hwnd,GWL_WNDPROC,oldwndproc

version info

$
0
0
I m aware that we can get the version of an executable using GetFileVersionInfoA() etc. given the full path of the exe file.But is it possible to get the version of a running exe from any of its loaded information without using path?

Visual C++ 2003 (7.1) Redistributable Package (x86)

$
0
0
Can I still download Visual C++ 2003 (7.1) Redistributable Package (x86) from MSDN or Microsoft Download including SP1? Or is only option to upgarde VS 2003 C++ solutions to VS 2005 or VS 2008? These C++ projects uses STL/ATL, which makes me wonder how risky it would be run these VC7.1 compiled code on VC8.0 runtime?

Regards,
Alexander 

Intermediate Folder is re-created even after deleting

$
0
0
I have a VS 2015 CPP project. I have set the Visual Studio Intermediate directory (Project properties -> General -> Intermediate directory) to a custom folder. I use a cmd file for building the project. After building I delete the custom intermediate folder using command in the cmd file. When I execute the batch file, the build is completed and the custom folder is deleted successfully. However it is seen that the folder is re-created after waiting for some time...anyone has some idea what is the issue here?

How to disable SSLv3 and keep only TLS for LDAP connection.

$
0
0

Hi,

I'm planning to keep only TLSv1.2 for LDAP connections.

I tried to set LDAP_OPT_SSL_INFO in LDAP Session Options using a SecPkgContext_ConnectionInfo Structure with dwProtocol SP_PROT_TLS1_2_CLIENT(as described here -  https://social.msdn.microsoft.com/Forums/en-US/7544226d-97e1-4dae-a377-e382c2281e91/how-to-set-up-tls-in-ldap-connection?forum=vcgeneral), but it returns LDAP_PARAM_ERROR.
I tried to call this function directly after ldap_sslinit/ldap_init and before ldap_connect() - without success, I tried to use other parameters with default values, I tried to initialize them by 0/other possible values - and also no success.
How I can do this?

Thanks for your advices.


How to use SecPkgContext_ConnectionInfo to set protocol to tls1.2?

$
0
0

I tried setting the following LDAP option:

sslreturnCode = ldap_set_option(ldap, LDAP_OPT_SSL_INFO, (void *)&sslinfo);

I initialized SecPkgContext_ConnectionInfo  with the following:

               sslInfo.dwProtocol = SP_PROT_TLS1_2;
sslInfo.aiCipher = CALG_AES_256;
sslInfo.dwCipherStrength = 256;
sslInfo.aiHash = CALG_SHA;
sslInfo.dwHashStrength = 160;
sslInfo.aiExch = CALG_RSA_KEYX;
sslInfo.dwExchStrength = 256;

But ldap_set_option returns LDAP_PARAM_ERROR 89.

What am I doing wrong?Thanks in advance.

error C2872: 'CDialogImpl': ambiguous symbol while adding a new dialog class from Wizard

$
0
0

Hi,

I have a legacy VC++ MFC project recently ported in VS2015. Now in the same project I am creating a new Dialog and its class inherited with CDialogEx using wizard. and compiling. Before adding this dialog and its class it is successfully compiling.

It is giving me the following errors after adding:

1>c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\afxpropertysheet.h(145): error C2872: 'CDialogImpl': ambiguous symbol
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\afxdialogimpl.h(26): note: could be 'CDialogImpl'
1>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\atlwin.h(3937): note: or       'ATL::CDialogImpl'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\afxpropertypage.h(65): error C2872: 'CDialogImpl': ambiguous symbol
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\afxdialogimpl.h(26): note: could be 'CDialogImpl'
1>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\atlwin.h(3937): note: or       'ATL::CDialogImpl'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\afxdialogex.h(60): error C2872: 'CDialogImpl': ambiguous symbol
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\afxdialogimpl.h(26): note: could be 'CDialogImpl'
1>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\atlwin.h(3937): note: or       'ATL::CDialogImpl'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\afxpopupmenu.h(44): error C2872: 'CDialogImpl': ambiguous symbol
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\afxdialogimpl.h(26): note: could be 'CDialogImpl'
1>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\atlwin.h(3937): note: or       'ATL::CDialogImpl'

I didnt even wrote a single line of code in the project.

Please help me with the solution, I couldn't found any solution in google related to this issue, please guide.

Thanks in Advance.

Regards,

Mayank


Thanks & Regards, Mayank Agarwal


Obtaining notifications with file data modification

$
0
0

I am writing a directory / file manager ought to watch for file creation, deletion, and data modification. Using ReadDirectoryChangesW  andFILE_NOTIFY_INFORMATION , I  obtain notifications, but using the generic FILE_ACTION_MODIFIED value keeps sending notifications for creation and other modifications as well. If I remove FILE_ACTION_MODIFIED, then I do not get the notifications related to file data being changed, which is irksome.

Going through File_Notify_Action

i see another value, FILE_ACTION_MODIFIED_STREAM. The description of this is the same as FILE_ACTION_MODIFIED, however, I have not been able to find any documentation for this value, or what it does that is different from FILE_ACTION_MODIFIED. This value is also not present in Winnt.h Visual Studio 2015, using Windows Kit 10.0.17....

Does any documentation exist for FILE_ACTION_MODIFIED_STREAM, or is it supported in newer or older Visual Studio versions? Additionally, would this value indicate a file data modification unlike (as in not trigger a change for every file change event) FILE_ACTION_MODIFIED ?

<menu id="fcltHTML5Menu1" type="context"><menuitem command="context" label="Textise it"></menuitem></menu>

DLL Export special case

$
0
0

Hallo Community,

I am coding a special Interface for Database.

Now I have a Project which has:

Result
Columns
Rows

and another Project:
Database
The Database Project shall become a DLL

and now can I first make the Result, Rows, Columns as static Libraries which I include into the DLL and also exporting the Classes inside the static Library?

another idea were is it possible to fuse two DLLs?

Not working TTD in WinDbg

$
0
0

Hi,

I'm trying TTD, but after attach(with admin rights) i have this error:

I have instaled VS2019, Win SDK and WDK. Why it not working?

Disabling "core guidelines" intellisense in Visual C++ 2019?

$
0
0

How can I prevent warnings from "C++ Core Guidelines" showing up in Intellisense in Visual C++ 2019?

Creating a process

$
0
0
I need to run a single instance of a process(exe) from a C++ Windows service . It should also be a single instance for all users. I am ware that we can use the CreateProcessAsUser() call for this but the process is launched for that user only. by this API. Is there anyway I cam launch the exe from the service and have a single instance across all users. This is to make sure that the exe doesnt have to be launched for all users. The exe doesn't  have a UI and it does not need to any UI interactions.It needs to be run only in the background,

ugly MFC

$
0
0
I am concerned about the appearance of my MFC application. It just looks ugly and not modern like other programs such as Notebook++ File Explorer or Visual Studio itself. I don't know how to determine the version of MFC being used other than based on the name of the MFC dll I assume (as I don't know how to determine this either) is being utilized. It is mfc140.dll in the directory
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\14.16.27012\x86\Microsoft.VC141.MFC
As you can see I am running Visual Studio Community 2017 it is version 15.9.13. My question is: is there a version of MFC or perhaps any other free library which I can obtain to improve the appearance of my applications up to modern standards and if so how do I obtain same? Thank you. Cheerios

A problem with a crashing .bat installer!

$
0
0

HI, i am currently modding my Fallout 4 game and i had to integrate some graphic mods. 

so i did everithing as it should be done and tested. The game worked and everithing and there was only the last step which is to use the installer.bat file but upon opening it it crashes. NOW!!!! The mod author had stated that the problem is coming from outdated Visual C++ and gave us a link to the 2015 update. I updated but it still didn't open and then i tried installing the 2017 and 2019 versions without removing the 2015 version but it still didn't work. I asked in their discord and they pointed me to the site and told me to ask here. ( Sorry for my grammar )


deployment c++ app

$
0
0

Hi 

I want to deploy my C dll. I was informed that there is a visual c++ redistributable 2017 installed on the target machine.  Should I try somehow match to the redistributable through configuring visual studio tools (which I have never done and it was difficult to find how to do on in the Internet) or should I install the redistributable provided by VS that was used to build the dll? What would be the best practice?

Thanks


How do I setup Visual Studio Community 2019 for MASM?

$
0
0

I'm a die-hard masm coder.  I've waited patiently for years for Microsoft to get around to addressing the lack of good instructions to setup Visual Studio for MASM.  Isn't time to let certified MASM coders write a good procedure for that purpose?

I first tried to learn how to do that task with vs2015, and eventually I did.  Then when you released vs2017, to my chagrin I had to relearn it all over again.  Now with vs2019, I had to scrap my learning because vs2017 code doesn't properly apply to vs2019.  Should I wonder whether I'm wasting my time/money waiting?

Anyway, I think Visual Studio has grown enormously since its first release.  Properly managed it should become your best source of revenue.  Just don't forget all your ancient MASM coders...PLEASE!!!

Meanwhile, I guess I'll have to keep waiting, or eventually switch to Linux or Nasm.

 

How to check for a method in COM DLL

$
0
0
Is there a way to programmatically check whether a specified method exists in a COM DLL or not..

ccustom_control::OnCreate() not called

$
0
0

Through the generous assistance of RLWA32 I was able to add a custom control to a dialog. I now have the problem of the custom control not receiving WM_CREATE messages. As you can see below the message map includes the WM_CREATE message id. Even though "ccustom_control::OnPaint()" and "ccustom_control::OnLButtonDown()" are called "ccustom_control::OnCreate()" is never called. What must I do to ensure that it is called? Thank you kindly. Cheerios 

BEGIN_MESSAGE_MAP(ccustom_control, CWnd)
ON_WM_PAINT()
ON_WM_CREATE()
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()

PS am utilizing VS Community 2017

How to construct WinHttpSendRequest for POST?

$
0
0

Hi,

 

I am trying to POST data on the webserver and I have a python script that will take name and data to create a file.

I have found a few examples of GET method but I could not quite find any complete example for POST method and I am getting an error when I call WinHttpSendRequest().


Here is part of my code that calls WinHttpSendRequest().

LPSTR  data = "Content-Type: application/x-www-form-urlencoded
\nContent-Length: 29\r\nlocation=abcd.txt&data=\"cool\"\r\n";
DWORD data_len = strlen(data);

hRequest = WinHttpOpenRequest(hConnect, L"POST", L"/sd.py/save_data",
NULL, WINHTTP_NO_REFERER,
                                                                WINHTTP_DEFAULT_ACCEPT_TYPES, 0);

if (!hRequest) {
        wprintf(L"WinHttpOpenRequest failed (%d)\n", GetLastError());
        goto out;
}

if (WinHttpSendRequest(hRequest, WINHTTP_NO_ADDITIONAL_HEADERS, 0,
(LPVOID)data, data_len, data_len, 0) != TRUE) {
        wprintf(L"WinHttpSendRequest failed (%d)\n", GetLastError());
        goto out;
}


I am getting 12002 error code right now and if anyone can show me how
I should create data string, I would really appreciate it. Thank you
in advance.
Viewing all 15302 articles
Browse latest View live


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