No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
24 Posted Topics
Hi, I've been searching the net to try to find solution but i still can't find it despite searching it for hours. I've got a user control in a form. From the user control, I plan to do 2 things. 1) In the parent form, i got function example FunctionX(). … | |
Hi guys.. I need advice on writing function in a multi-threaded envionment Lets say I have a function which squares an integer. [CODE] int Square(int num) { // May do other things which might take long time to complete. return num*num; } [/CODE] This function is called in threads eg … | |
Hi guys, I've been struggling for days to do this. I've got 2 form. The first form (Form1) is to assign a variable (Result) a value. Another form (DisplayResult) is to display out the value. Actually, my purpose is to learn how i can use global variables to share information … | |
Hi Guys, I have a database table where the field is type integer. In my program, i use [CODE]bstrTemp = static_cast< BSTR >(_myClass.m_QueryCommand.GetValue( 1 ) // using OLEDB consumer[/CODE] the variable "bstrTemp" is type CComBSTR. Lets say after retrieving the date from database, the value is 56(integer). When I execute … | |
Hi guys, Lets say I create a class pointer in my program, do I need to delete the pointer I created before I close the program? Or will the pointer be deleted automatically whenever I exit the program? Will it cause the PC memory to be locked up if I … ![]() | |
Hi, I get "error LNK2005:" when I build my source code. Below is what I did: Main.cpp [CODE]#include Main.h Function();[/CODE] Main.h [CODE]#include "File1.h" //#include "File2.h"[/CODE] File1.cpp [CODE]#include "File1.h" void Function() { // Do something }[/CODE] File1.h [CODE]extern void Function()[/CODE] File2.cpp [CODE]#include "File2.h" void Function() { // Do something }[/CODE] File2.h … | |
Hi, How do I correctly call a function which expect BSTR* as a parameter? eg: [CODE]void FunctionA(BSTR* b) { // Do something }[/CODE] Currently, my code is as follow: [CODE]void Caller() { BSTR* pbstr; FunctionA(pbstr); }[/CODE] However, during compilation, I get warning "local variable pbstr' used without having been initialized". … | |
Hey, I was just testing/learning with classes and i'm stuck at how to instantiate the class. I've spent few days trying get myself out of this mess but i don't think i'm getting anywhere. The picture below shows where I'm stuck at. The sln file is attached below for reference … | |
hi, i'm did a program in C++6.0 that retrives data from Access. the program was ok and runs normally for quite sometime and suddenly the error [B]"Unable to Create File Buffer"[/B] appear. After searching high and low for solution and trying multiple suggestions, i found that that problem is because … | |
Here are the classes that i've attempt to create as well as tried to use them but failed. [CODE]using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Project.GlobalVariables { static class IOCard { public const int TotalInputCard = 10; public const int TotalOutputCard = 10; public class InputCard { public … | |
Hi, Can somebody please advice me on raising/throwing custom exceptions? Here is what I'm trying to do. [CODE] //MainFunction() will call SubFunction() to perform some ADO function. MainFunction() { try { SubFunction() //OtherFunction1 //OtherFunction2 } catch(...) { //to catch custom exceptions raised by me in SubFunction() so that it will … | |
Hi, I'm doing a program to capture from USB camera. And to do the program, I need directshow which can be found in directX sdk. I read that the new versions of directx are not compatable with VC++ 6.0. Does anybody know where I can get an old version which … | |
Hi, I've got a modeless dialog. When user click the X button at top right hand corner, I want to catch the event and do some processing. What event do I use for that..? I cannot find OnClose event in the event handlers box. Btw, I'm using VC++ 6 (MFC). … | |
Hi guys.. In my dialog, under void Class::DoDataExchange(CDataExchange* pDX), whenever i call DDX_Control(pDX, IDC_SOMETHING, m_VAR);, I got problem. After some digging, the problem is the function below. [CODE]HWND CDataExchange::PrepareCtrl(int nIDC) { ASSERT(nIDC != 0); ASSERT(nIDC != -1); // not allowed HWND hWndCtrl; m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl); //<---- hWndCtrl = 0 if (hWndCtrl … | |
I'm trying to figure out how to change the edit box colour when I click on the button. Btw, i'm using VC++ 6.0 (MFC). One way I can do is assign a colour variable. When I click the button, the colour variable changes. When the program call the OnDraw function, … | |
Hi, I'm doing a program in dual core processor. I'm wondering, is it possible for write a program that is core specific..? For example, thread A only runs at core 1 and thread B only runs at core 2. I'm currently looking at [URL="http://www.threadingbuildingblocks.org/documentation.php"]IntelĀ® Threading Building Blocks (TBB)[/URL].. Am I … | |
Below is a simple code that i wrote about VARIANT. The weird thing is at the end of the code, both vtEmpName and vtDept is "Accounting". [CODE] VARIANT vtEmpName; VARIANT vtDept; vtEmpName.vt = VT_BSTR; vtEmpName.bstrVal = _bstr_t("Joe Schmoe"); vtDept.vt = VT_BSTR; vtDept.bstrVal = _bstr_t("Accounting"); [/CODE] On the other hand, if … | |
Hi, I'm doing a code in MFC to retrieve DateTime from SQL 2005 and then after do datetime manipulation on it. In the SQL table, the date field is 3/16/2010 2:28:20 PM (obtained by using getdate()). I then retrieve the date from RecordSet and stored into _variant_t. To confirm that … | |
Hi, I'm doing a dialog box in VC++ 6.0. Can somebody please advice me how do I put an icon/bmp file on the title bar..? (Refer to the picture attached) I've tried searching it in books and google but i couldn't find anything. Thanks. | |
Hi, I've got a dialog box and I use picturebox to put bmp background picture to fill the whole dialog box. After that, I draw some textbox and button in the dialog box. My intention is to have the buttons and textbox infront of the picturebox. But what happen instead … | |
Hi.. Can somebody please advice me on how to set a powerpoint presentation as the powerpoint.application.activepresentation? In the program below, when the form is loading, it will open 2 powerpoint files (Test1.ppt and Test2.ppt). After Test2.ppt is opened, it will be the activepresentation because it is opened last. What I … | |
Hi, I've done a vb.net program. The program basically uses few reference for example system.io etc.. In order for my program to run on another computer, the computer need to have .net framework 2.0 installed.. Instead of installing the whole framework, can I just pack the references I used in … | |
Hi, I'm currently doing a program to search for text in powerpoint files using interop in vb.net 2005. When a user does a search, it will open the powerpoint (.ppt) file and do the search. This is working fine. What I want to achieve next is if the powerpoint file … | |
Lets say I have a text file which contains a long list of 8bits data and i want to create a .wav or .au file from it. Forexample, my text file contains 8000 bytes for 1 second of audio with the sample rate of 8kHz. How do I create a … |
The End.