|
zainu wrote:
For this I want to get the recordset of CListCtrl object.
A CListCtrl object does not contain a record set, ADO or otherwise.
I've not ever used ADO so I may be off, but I think you'll need something like:
#import "c:\program files\Common Files\System\ado\msado15.dll"
_ConnectionPtr pCn;
_RecordsetPtr pRs;
CoInitialize(NULL);
pCn.CreateInstance(__uuidof(Connection));
pRs.CreateInstance(__uuidof(Recordset));
pCn.Open(...);
pRs.Open(..., pCn, ...);
for (int x = 0; x < m_listctrl.GetItemCount(); x++)
{
CString strText = m_listctrl.GetItemText(x, 0);
pRs->AddNew(...);
}
pRs.Close();
pCn.Close();
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi
I want to integrate an activeX control (NTGraph2D) in my Visual C++ .Net 2003 application for displaying graphs, but I´m not sure how to do it.
Could somebody give me a clue, as I am quite new to both VC++ .net and activeX controls?
(I have tried to search these pages also, but I didn´t find any articles that mached my needs)
best regards,
eirik
|
|
|
|
|
I was looking at the Automation Object Model chart and saw the VCProject object. In the help files I see an example where the VBProject is retrieved using DTE::GetObject("VBProjects"). I was wondering does anybody know how to do it for the VCProject and what IDispath derived object I need?
I am the handsome one in the crowd.
|
|
|
|
|
Hi,
In order to create a virtual COM port(for BlueTooth Comunication),
I need the address of the BlueTooth device.
I know the BD_ADDR,but i must convert it to BT_ADDR if i want to use
the RegisterDevice() function.
anyone?
Regards,
Eli
|
|
|
|
|
hi every one,
i am connecting two computers using dial-up connection (modem to modem on phone line)...very after the connection is established btw two computers you can see the client and server ip addresses by double clicking the connection status window in system tray.
all i need to access the both ip addresses programatically in vc++ 6 or 7 or c#...
plz let me know if someone could help me on this email address
msherazkhan@hotmail.com
i 'll be thankful
|
|
|
|
|
Hi all,
I've a problem: copy files to remote computer using Window XP by programming.
I have found WNetAddConnection2 function, but when I try to use this function connect to remote computer use WinXP with user has administrator right, it alway return "5" (Access Denied).
Here is my code
==================RemoteConnect.cpp=======================
#include <windows.h>
#include <stdio.h>
#include <winnetwk.h>
void main(){
NETRESOURCE nr;
DWORD res;
TCHAR szUserName[32] = "administrator",
szPassword[32] = "",
szLocalName[32] = "Q",
szRemoteName[MAX_PATH] = "\\\\sas\\C$";
//
// Assign values to the NETRESOURCE structure.
//
nr.dwType = RESOURCETYPE_DISK;
nr.lpLocalName = szLocalName;
nr.lpRemoteName = szRemoteName;
nr.lpProvider = NULL;
printf("%s\n", nr.lpRemoteName);
//
// Call the WNetAddConnection2 function to assign
// a drive letter to the share.
//
res = WNetAddConnection2(&nr, szPassword, szUserName, FALSE);
//
// If the call succeeds, inform the user; otherwise,
// print the error.
//
if (res == NO_ERROR)
printf("Connection added %s\n", szRemoteName);
else
printf("Error: %ld\n", res);
return;
}
==========================================================
Anyone know why this function failed?
If possible, please show me the solution to connect to remote computer using Win XP by programming (using WNetAddConnection or the other solutions).
I've hear about tftp, but i wonder that, if the remote computer don't have tftp listening, how can i use tftp to copy the files to it?
Please, help me find the right solution to do that.
Many thanks.
.::LDLP::.
|
|
|
|
|
L D L P wrote:
I've a problem: copy files to remote computer...
please show me the solution to connect to remote computer using...
So what are you wanting help with, copying a file, or connecting to a remote computer? There is no need to connect to the remote computer (via WNetAddConnection2() ) just to copy a file to it.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I just want to copy mutilple files to it, into many folders of it.
How can i do that? Note that I want to copy to Win XP computer
.::LDLP::.
|
|
|
|
|
L D L P wrote:
I just want to copy mutilple files to it, into many folders of it.
You can use CopyFile() , CopyFileEx() , or SHFileOperation() for this. The first two operate on one file at a time, while the last one supports wildcards.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi
Bring window on the top use the function "SetForegroundWindow".
Is there any function to minimize the window?
|
|
|
|
|
If you are Using MFC
this->ShowWindow(SW_MINIMIZE);
if you are Using Win32 api based Application
ShowWindow(hWnd,SW_MINIMIZE);
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
ting668 wrote:
Bring window on the top use the function "SetForegroundWindow".
Are you wanting to know the syntax of this function, or are you already using it but it is not producing the desired results?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
by clicking the minimize button !?
;);P;)
don't answer, it was just a joke
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
<br />
extern CListCtrl* pmyListCtrl;<br />
extern LPCTSTR lpszmyString;<br />
<br />
LVFINDINFO info;<br />
int nIndex;<br />
<br />
info.flags = LVFI_PARTIAL|LVFI_STRING;<br />
info.psz = lpszmyString;<br />
<br />
string lpszmyString.<br />
while ((nIndex=pmyListCtrl->FindItem(&info)) != -1)<br />
{<br />
}<br />
<br />
But my doubt is will the above code search all the columns and rows in the listctrl, or just the 1st column, for the lpszmyString string
?
That is I want the code to search only the first column to be searched for the string.
Thank you.
|
|
|
|
|
By definition, it finds items (i.e., the 1st column). Having never used it, I can't be for sure.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi all,
I want to create and read/write a file. If I use fstream class, I can open only the file already exits.
If I want to create a new file. What can I do?
Thank you very much.
Tran Phuong Nga
|
|
|
|
|
tpndtbk wrote:
If I use fstream class, I can open only the file already exits.
If I want to create a new file. What can I do?
use ios::in in Second Parameter of fstream object initialization
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
HI,
I did like following:
fstream *fout;
fout = new fstream("data.dat", ios::in | ios::out | ios::binary);
fout->write((const char*)name, sizeof(Names));
//Names is a struct and name is a variable of Names type
fout->close();
-----------
So what is wrong in these codes?
I run this code, no errors but the file is not created!
Thank you
|
|
|
|
|
I tried your code (except I did not use a pointer) and it worked as expected. Perhaps it is a permission-related issue.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
As with David's comment above, but also be aware of the location that your file is being created.
tpndtbk wrote:
fout = new fstream("data.dat", ios::in | ios::out | ios::binary);
You supplied only the filename, not a definite path, which means that the file will be created in the current directory. This, in most cases, may very well be in your ..\debug\ subfolder.
I Dream of Absolute Zero
|
|
|
|
|
HI,
THank you.
My program runs without any error but there's no file created. I think I have problem with writing permission. But I don't know how to solve it.
Can anyone help me out?
|
|
|
|
|
And there's a strange thing that:
If I write:
fstream *fout;
fout = new fstream("data.dat", ios::in | ios::out | ios::binary);
if (!fout->is_open())
{
cout << " can't open the file" << endl;
return 1;
}
fout->write((const char*)name, sizeof(Names));
---> the result is "can't open the file";
But if I don't check if the file is open.
fstream *fout;
fout = new fstream("data.dat", ios::in | ios::out | ios::binary);
fout->write((const char*)name, sizeof(Names));
--> there's no error but there's no file created. I think if the file doesn't exist, the instruction "fout->write((const char*)name, sizeof(Names));" should cause an error. Right?
|
|
|
|
|
Hi,
I'm trying to set up BlueTooth comunication between 2 devices,by using Virtual COM Port,with the RegisterDevice() function.
The problem is that the last parameter required the BD_ADDR(BlueTooth address) of the device i want to connect to.
How can i get the asddress????
Regards,
Eli
|
|
|
|
|
BTH_ADDR which is a MAC address,
not BD_ADDR that is an IP address
but i don't remember how
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
First,thanx for your prompt reply.
According to MSDN:
When the client or server starts, it creates a COM port to associate
with the Bluetooth stack in the following manner:
HANDLE h = RegisterDevice (L"COM", index, L"btd.dll", (DWORD)&pp);
For the client, the Bluetooth server address (pp) is passed into the
pp.device member in the PORTEMUPortParams structure(and pp.device type is
BD_ADDR).
Anyone???
Regards,
Eli.
|
|
|
|