The cell's value can be a formula. Try this in your excel interop code (assuming you have excel interop code):string value = (string)(workbook.ActiveSheet.Cells[row, col].Value2);
See if there are associated commandline parameters, config files, or failing that, registry entries that you can change. If there aren't any of those, your only recourse is to get the window handle and programatically, change the settings via the given app's UI (and not only is that ugly, but...
In C# We Have This Below : private string Base64Encode(string plainText) { var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText); return System.Convert.ToBase64String(plainTextBytes); } How I Will Do It In VC++ 6.0 ...
Hello, I am working on .xlsx file on windows in VC++ MFC and trying to create table in its worksheets. I am using XLS2007::ListObjects::add function for creating table but function fails every time. Please have a look what I am doing: What I...
I am created illustrator plugin in c++. I want to call SOAP web service in plugin. i am trying bellow code but not getting responce. What I have tried: IServerXMLHTTPRequestPtr pXMLHTTPReq = NULL; hr=pXMLHTTPReq.CreateInstance(__uuidof(ServerXMLHTTP60)); hr =...
Hi all, I was migrating our project from 2010 to 2015, but I was facing linking issue saying that atlsd.lib was not able to open. The installation folder for VS2015 "C:\LegacyApp\VisualStudio2015\VC\atlmfc\lib" doesn't have debug version of this lib, but it has release version "atls.lib" I have...
I have a vc++ based ActiveX control which has edit box which shows "?" While typing romanian s cedilla.I am using GetWindowText() to get the text. Its legacy project and multibyte is set as charater type in project settings.Only S/T cedilla I am...
I can find window version and screen resolution through mfc by different available functions.But how to find display percentage magnification. For example 100%,150%,200% through mfc functions. Please let me know function names. What I have tried: I have googled for the...
For adding TLS 1.2 I found following string System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; But this string is not compatible with VC++ 6.0 unmanaged code. Task infront of me is to add TLS 1.2 support.Database used in SQL...
I have a little experience in add-ins with c#, but I believe that you will understand the concept.I believe that you should use Microsoft.Office.Interop classes with COM to create it.To find the current selected Microsoft.Office.Interop.Outlook.MailItem you can use this: ...
i created a dialog box while clicking on the button.but when i again clicked again dialog box is creating. i want to create it on the first click. when the button is clicked further clicks should be disabled.can u help me to do this?What I have tried:i created a dialog box while clicking...
I am trying to create the following scenarios tab control using MFC.Tab1 tab1 tab2Tab2 tab1 tab2I was created parent Tab control and can able to control the tabs. I can't find any example relating to this. If it is possible, any one share some examples or useful...
I am currently developing some addition code as dll for one third party executable. For debug of my DLL using third party exe, I am providing executable path in debugging property. Project propertyAll things are working properly unless they release new version of executable. They...
We are migrating our project from vs2005 to vs2015 . In one of the project we are using Ad1.lib .When I build that project in vs2015 getting the error saying Ad1.lib not found . In vs2005 this lib was present in " C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\Lib " but I...
We are migrating our projects from vs2005 to VS2015 .In one of the project we are using below template declaration template In 2005,it is building successfully but in vs2015 getting below error. 'WindowClass': illegal type for non-type template...
We are converting our projects from vs2005 to vs2015. We able to clear the build error but now we are getting runtime error at LoadTypeLib function call Error is "Error loading type library/DLL" Below is the code HRESULT LoadTypeInfoFromThisModule(REFIID riid, ITypeInfo **ppti) { *ppti = 0;...
I want to understand which hook is used for what purpose. What I have tried: I have googled and only difference I understood is WH_KEYBOAD will inject the dll into the processes but for the WH_KEYBOAD_LL windows will make a direct call to call back function without injecting the dll. So...
We have a com dll from third party and using that com dll from the vb script. We want to remove the third party dll and write our own dll with same name and object so that we dont need to change anything in our scripting code. I created the new...
CEdit* pEditControl = (CEdit*)GetDlgItem(IDC_ID); POINT CaretPos; ::GetCaretPos(&CaretPos); pEditControl->SetSel(CaretPos.x, CaretPos.y); What I have tried: Can some one help me with this
You know you might convert screen coordinates to client ones (or viceversa).As an alternative, you might detect when the mouse pointer 'exits' from your application window (see WM_MOUSELEAVE message[^]).
Quote:Msg_t *new_node[10];The above line create an array of 10 pointers. Fine.Quote:new_node[0]->message_id = ...In order to make the above line work, new_node[0] must point to a valid Msg_t instance while it is pointing to garbage.You have to write something likenew_node[0] = new...
As Richard pointed out, if you want to do socket programming then you have to use IP addresses (or hostnames, and anyway, you haven't to worry about the IP address assigned to your own ethernet card). In order to start with socket programming you have to read the f#*?+° (fantastic)...
There are several ways to accomplish such a task. You can, for instance, use the Tokenize[^] method to extract all (the string representations of) the octects ant then convert each string to the corresponding byte (e.g. using itoa[^]).
Here at CodeProject you may find a lof of articles on reading/writing values from/to the registry[^].You might also use the WriteProfileString function (Windows)[^] for such purpose.
In order to write, you may either use a loop, calling at each iteration SetWORDValue or SetQWORDValue (as appropriate) or, without the loop, calling just one time SetBinaryValue (see CRegKey Class[^]).You may read back the data in a similar way.You might also have a look at one (or more)...
Have a look at Newcomer's Threads and Processes series. Please note 50 ms is a relatively short time for Windows OS. Moreover, in order to keep your application responsive the 'active' (i.e. not sleeping) part of your code should be a small fraction of 50 ms (that is your thread should be...
In addition to Richard solution, have a look at c++ - Is it bad practice to allocate memory in a DLL and give a pointer to it to a client app? - Stack Overflow[^]. Unfortunately mismatches between allocator and deallocator do happen and are not pleasant.
Quote: int nfRet = SockConnection.Send((char*)&command_header, sizeof(command_header)); nfRet = SockConnection.Send(command_header.iDataBuffer, sizeof(command_header.iDataBuffer)); The above calls don't make sense. On my system sizeof(command_header)=8 ...
COM interfaces are immutable you shall not try to change them. You have to create new interfaces. From the documentation[^]: COM interfaces are immutable. You cannot define a new version of an old interface and give it the same identifier. Adding or removing methods of an interface or changing...
Have a look at this code samples: MFC Sockets[^]. Have also a look at this CodePrject article: Sending & Receiving UDP Datagrams with MFC's CAsyncSocket C++ Class[^].
Could be a name clash. Try to change the name of the class or, better, enclose it in a namespace. By the way, the compiler message should indicate where it was already defined.
Quote: i have a string value and i want to convert string value to TCHAR value. A string is a sequence of characters, while TCHAR is a single character (either char or wchar_t as already pointed out by Richard), so you cannot convert. As a wild guess, I suppose you need to convert from a string...
What about the documentation[^]? I've underlined it for you: Because of their potential for security issues, by default, these functions cause deprecation warning C4996: This function or variable may be unsafe. Consider using safe_function...
Hi,I have a tree control and I want to set focus on the top most item.Im using the following function but its not setting.HTREEITEM htiRoot = m_treeAvailableGraphs.GetRootItem(); m_treeAvailableGraphs.SetItemState(htiRoot, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED |...
Hi All, I'm trying to declare a CPen object in class scope and using it in OnDraw(...).But my application is crashing when I run it.If I declare the object in OnDraw(...) it is working fine. Can anyone please let me know do I need to any extra thing if declare CPen object in class scope? Thanks...
Hi,I'm calling a modal dialog from a java application. But if I click out of that, dialog is minimizing which I don't want because it is a modal dialog box. I have tried by giving property WS_EX_TOPMOST but it is always showing dialog on top even if I switch to other applications.I have...
"CodeProject" did not write the control. The person who wrote the article you got the control from wrote the control.There is a forum at the bottom of the article your got it from. Post your question there and the author should support the code he wrote.
You obviously have no idea what a MAC address is or what it's used for.You can NOT use a MAC address to talk to a device from your application. It is a hardware address used to uniquely identify a device on a physical network segment and ensure a physical signal gets to the correct device on...
You don't. UDP has no guarantees of delivery nor in the order that packets show up at the receiver and the possibility of duplicate packets also exists! There is NO WAY around this. If you want "reliable" data transfer, UDP is the LEAST reliable transport there is. You're going to have to use...
It's probably because you're using a trusted connection in your connection string. Using a Trusted Connection means that the user credentials presented to the database to login are the ones the code is running under. In the case where your database code works, the code is running as YOU. In...
Unless you've got some kind of server running on the target machine that will retrieve the contents of memory and send it to your client, it's impossible to get the memory of a remote machine.
In want document View application holding some button and some menus after clicking that button or the menu respective dialog box should appear.And I have to pass some data from document view to dialog also.So can anyone help me to solve this issue or share some code or link ...What I...
I need code to read data from text file and display the data in Tree Control...With a condition if, the text in the file not preceded by tab, it should be in parent node and if preceded by tab, it should be in child node. Example: Notepad contains two lines..... Hello -> (not preceded by tab...
Iam developing an MFC Dialog application that is stored in DVD. Suppose User runs this application from DVD and eject DVD while the application is running. Is it possible to close the application by default.What I have tried:I have handled WM_DEVICECHANGE notification and invoked...
Iam creating an application that requires to store passwords in file. Iam planning to use CArchive. I want to encrypt the data before saving. After googling i think BCryptEncrypt is the only option. Which algorithm is best for password saving. Please advice. Please provide any sample code also ...
I used SHA256 algorithm for getting hash. THe hash produced by my application is not same as the one generated by online tools for the same string. What I have tried: BCRYPT_ALG_HANDLE hAlg = NULL; BCRYPT_HASH_HANDLE hHash = NULL; ...
I am writing code in C++ on Visual Studio 2015 and using standard XML libs that comes with Windows APIs.Below is a sample XML file that i have. 1.0.1 Sample XXX ...
I'm having a dialog based app written in VC++ using Visual Studio 6. It's a simple app with very few texts, but now those needs to support multiple languages. As it's not many texts, the plan is to add all the different languages into just one string table with a unique identifier. So now a...
This is more of a design suggestion that I want to hear from C++ experts here. I have a C++ DLL in VS 2015 IDE. I want to add more exception handling into this code. Currently there's a function as follows. void Metrics::GetNumbers(InputParams* input, OutputParams* output) { int i, x, k; ...
I need to select columns of text when alt and mouse left key is down and dragged. I need to implement the operation which exists in visual studio as we select columns of text with alt and mouse left key is clicked and dragged. Thanks in advance What I have tried: I dont have any idea of...
It can be compared with dword type. For example, you can use follow macros. #define str2dword(sip, ip) { \ DWORD _2, _3, _4; \ _stscanf_s(sip, _T("%d.%d.%d.%d"), &ip, &_2, &_3, &_4); \ ip = ip | (_2
You can use raw socket programming to exchange packets on low level using Ethernet protocol.Ethernet use a binary address unique for each comm card made of 6 octects named MAC, that is the short for Media Access Control address, a hardware address that uniquely identifies each node of a...
i have a simple sizing dlg with a richedit 2.0 control - 2 problems:1 - i do not see how to apply formatting - do i someho need to capture right click and create a context menu?2 - when the data is retrieved from the ctrl, there is no formatting instructions so it's saved as plain txt to the...
Given you dont show us any code its a bit of a guess for us as to how to help you. In short, if you're using PROCESS_INFORMATION processInformation = {0};in your call to CreateProcess, you can then WaitForSingleObject( processInformation.hProcess, INFINITE );DWORD exitCode;BOOL...
I am working on a project where I am interacting between the components of VC++ (Server) and C# Client.The C# component is been triggered by VC++ and further interactions happens between these components over Control Pipes.The Control pipe is created at the VC++ as...
You may derive your own class from CVSListBox and override the virtual method BOOL EditItem(int iItem){return FALSE;} returning false. Since the new and delete buttons may be useless in this situation you may remove any of them by setting the desired flags in SetStandardButtons(UINT uiBtns =...
You can try the other method described here: Adding a Member Variable[^].If this does not help do it manually by adding the variable definition to the dialog header file and map the list control to the variable in the dialog class DoDataExchange[^] function using DDX_Control.
Enhancing my comment post as answer with a reasonable error source.The LoadImage() call with path and LR_LOADFROMFILE should work. If it fails (return value is NULL), you should call GetLastError() to get an error code and optionally look up the error message.If the error code is 5...
CArchive is not intended to read common text files. It is used to save and store a binary representation of the data used by your application (commonly the data hold by your CDocument class). If you use the CArchive string functions, they will use Unicode strings with Unicode builds and...
You are creating a CTest instance on the stack and trying to delete it aftwerwards. That will of course crash because you can only delete objects that has been allocated on the heap using new.So you would probably want to do something like this (depending on the type of the second std::pair...
Handle the NM_CLICK (list view) notification code (Windows)[^] and NM_DBLCLK (list view) notification code (Windows)[^] notification messages in your parent window. The LPARAM parameter for these messages is a pointer to a NMITEMACTIVATE structure (Windows)[^] containing all necessary...
Really VC 5? For which Windows version?Since Windows NT normal applications have no direct access to hardware. You always need a driver.Because parallel ports are outdated, it is difficult to find still working examples. But this site may be a good starting point: Jan Axelson's Lakeview...
The rightmost parameters are for the source which is probably the original (not zoomed image). So you have to calculate the destination parameters (the left most ones).To support zoom in/out you must track the actual zoom factor in a variable that is initialised with 1. Then adjust this upon...
It is not quite clear what you are looking for but I will try to answer.If you want to make updating the list items faster, you can disable redrawing while inserting and changing items:// Disable redrawing while updating the listSetRedraw(FALSE);// Add or update items...
This has been asked and answered multiple times. It is just a question of finding the correct search term. I used "c++ parse ip string" and got a lot of useful results:C++ how to convert ip address to bytes? - Stack Overflow[^]c - parsing ip adress string in 4 single bytes - Stack...
See CListCtrl::EditLabel[^].If you want a different behaviour you have to implement it yourself. Some examples from CodeProject:Editing Sub-Items in List Control[^]In-place editing of ListView subitems[^]An Extended MFC CListCtrl to edit individual cells, sort headers, and...
In your OnNMClickList2100 handler you are selecting an item (a row) when clicked on it. But this will not remove the selection from other actually selected rows so that you may have multiple selected rows.What is the purpose of handling that on your own? The default handling will select the...
See the CodeProject article MFC under the hood[^]. It explains the startup and initialisation process of MFC applications describing which functions are called.
You are calling CreatePen again and again with each drawing.The simplest solution would be calling CreatePen in the constructor of your class and remove it from the draw function:CMFCApplication2View::CMFCApplication2View(){ // Other initialisation goes here ...
Some of your example strings are not valid URLs (see Uniform Resource Locator - Wikipedia, the free encyclopedia[^]) or valid URIs (Uniform Resource Identifier - Wikipedia, the free encyclopedia[^]). So you have to define first what is allowed / to be supported.This might be for example that...
The EN_CHANGE notification is send whenever the text is changed by user input or by setting the text using SetWindowText() / WM_SETTEXT for single line edit controls.You have probably one or more places where the edit control is initialised when the parent window (a view in your case) is...