|
|
I use a table named FDetails with 4 text fields and a datetime field named date in MSaccess
when insert values into table ising ado recordset obj I receive some syntax error
recordset->Open("INSERT INTO FDetails(name,path,duration,volume,date) VALUES('hello','location','duration','vol','12/12/2000')",connection.GetInterfacePtr(), ADODB::adOpenForwardOnly,ADODB::adLockReadOnly, ADODB::adCmdText);
any one know inserting date into table
|
|
|
|
|
GANsJob wrote: when insert values into table ising ado recordset obj I receive some syntax error
And that error would be what?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
the error is
syntax error in insert into statement
|
|
|
|
|
See here.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
Try change the field name 'date' to 'date1'. If I remember correctly, date is a reserved word in ms access.
cheers..milton kb.
|
|
|
|
|
Hello All,
I am using a Win32 regular Dll . I want to call a function written in VB application using function pointers.
The snippet from Win32 dll is as follows:
typedef int (*pt2Function)(char*);
pt2Function Objectpt2Function;
EXPORT int PASCAL PassPtr(int (*pt2Func)(char*))
{
pt2Func("arun");
return 1;
}
The Snippet from VB Application is as follows:
Public Sub Callbackfuntion(ByVal str1 As String)
MsgBox "Callbackfuntion"
End Sub
x = PassPtr(VarPtr(Callbackfuntion))
This all results in the application crash....
Can anyone suggest me a solution how I can call this function??
Thanks in Advance
Arun Tayal
|
|
|
|
|
You cannt call a VB function from c++ without using COM, because all vb dlls are com components. SO the typical win32 dll function call approch using typedef wont work here. You cave to use
#import yourvbcomponent.dll <br />
<br />
CoInitilaize(NULL)
yourvbcomponentLib::_vbclassPtr clsPtr(yourvbcomponentLib::vbclass)
<br />
CString msg = "tst msg";<br />
BSTR bstr = msg.AllocSysString();<br />
clsPtr->Callbackfuntion(bstr);<br />
SysFreeString(bstr);<br />
cheers....milton.
|
|
|
|
|
Im trying somewhat simplest idea of sockets app using multicast.
Following is what SockApp1 does:
1) OnButtonCreate() creates the port, default OS assigned port. Create(0, SOCK_DGRAM)
m_pUDPSocket->Create(0, SOCK_DGRAM);
2) When OnButtonInitMulti() the mutlicast group(ip/port) is initialized.
memset(&m_addrMulti,0,sizeof(m_addrMulti));<br />
m_addrMulti.sin_family =AF_INET;<br />
m_addrMulti.sin_addr.s_addr =inet_addr(MULTIADDR);<br />
m_addrMulti.sin_port =htons(MULTIPORT);
3) When OnButtonSend()it sends the data to the group.
SendTo(m_sendBuffer, m_sendBuffer.GetLength(), <br />
(const SOCKADDR* )&m_addrMulti, sizeof(m_addrMulti));
SockApp2 with following buttons clicked:
1) OnButtonCreate() creates the port, default OS assigned port. Create(0, SOCK_DGRAM)
m_pUDPSocket->Create(0, SOCK_DGRAM);
2) OnButtonJoinMulti() joins the multicast group.
ip_mreq mreq;<br />
memset(&mreq, 0, sizeof(ip_mreq));<br />
mreq.imr_multiaddr.s_addr = inet_addr(MULTIADDR);<br />
mreq.imr_interface.s_addr = htonl(MULTIPORT);<br />
<br />
if(SOCKET_ERROR == SetSockOpt(IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)))<br />
{<br />
AfxMessageBox("Error: Unable to add membership");<br />
return -1;<br />
}
here...
#define MULTIADDR "224.0.1.129"<br />
#define MULTIPORT319 5009
Now, SockApp1, when i click onto the Send button, OnButtonSend() shud get called in which im doing the SendTo() thing. Uptill here the App1/App2 both are working fine, and the data is being sent successfully, this im sure.
The problem is, that SockApp2, which joined the group, is unable to receive the data being sent from SockApp1.
Now, SockApp1 and SockApp2 are actually a single app, called SockApp. I added SockApp1/2 names just for the clarity of the question and understanding.
At this moment, im just wondering... why SockApp2 is not receiving the data from SockApp1???
Any ideas why?
Best regards,
JT!
|
|
|
|
|
any one???
Best regards,
JT!
|
|
|
|
|
I got error as follows
_CrtISValidHeapPointer(pUserData)
as assertion error what is that?any one help me
|
|
|
|
|
Can you be more specific please
whitesky
|
|
|
|
|
Just file reading i am reading,the whole coding is going process fine,but after InitInstance the control goes to disassembly and shows this error and sometimes unhandled exception error is also coming.
|
|
|
|
|
can you show your code that has error,please
whitesky
|
|
|
|
|
It means you're trying to delete (or free or some other heap allocation function) memory you shoudn't. Possible reasons;
- Freeing already freed memory;
- Freeing memory not allocated on the heap;
- Freeing an address in the middle of a heap block (e.g. delete ((new int[2])+1); ).
Steve
|
|
|
|
|
What line of what file is asserting? Without context, the error is rather meaningless.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
_CrtISValidHeapPointer(pUserData)
To find out what's wrong with this line, declare pUserData as constant pointer and see where you get compiler errors.
|
|
|
|
|
An assertion is something the System Uses,(and you should also use them) to make sure that an assumption is actually the case. If it is not, it will throw an exception. In this case, if you use free(p), it assumes that p is a valid heap pointer. That assumption is tested, or asserted deep in the bowels of the code, and in this case it failed, pUserData is NOT a valid heap pointer.
Go back on the Call Stack to find out what is being freed, and take it from there
LateNightsInNewry
|
|
|
|
|
Hi.
I'm coding a c++ dll with visual studio 2005 and in my project configuration properties, the Common Language Runtime Support is set to "no".
What I want is to get executables which may run in every windows machine without the need of the .NET framework, and I was wondering if I'd need another IDE to do that.
Also I'm having problems mixing up a VB 6 program which uses a c++ dll compiled with vs2005. When I run the vb executable, it holds in the process list once it's close. Nevertheless, if I compile the same VB code with vs2005 and use it with the same dll, it all works like a charm.
If you don't know the answer, clues and tips are also welcome.
Thanks in advance.
|
|
|
|
|
You can write a component without .net frame work support using .net 2005 IDE. whatever settings u had given is correct only.
Regarding the vb6 issue, first of all i dont understand how could u compile vb6 application using .net2005. Because 2005 will convert ur vb6 project to a .net project which uses .net framework.
If u have process hanging issue with 2005 compiled dll, then it is better you go for vc++6 ide and compile the dll over there. The diffrence in C Runtime used by 2005 and vb6 can cause this problem. I auusme vb6 runtime will use C Runtime, not your vb6 application.
cheers...milton kb
|
|
|
|
|
Hi,
I want to check the system idle state, and want to do some operations on the idle time.
I had created a thread to check the system idle state.
My idle state conditions are
1. CPU usage must be less than 10%
2. There must be no load on the hard disc.
First condition is ok( I can use GetSystemTimes() to get the idle time...pls mention if any other suggessions )
But how can I check the hard disc load?
Regards,
Ajay
|
|
|
|
|
Im sure there are one (or more) performance counters that you can use for disk activity, if not, WMI might be able to help
'g'
|
|
|
|
|
yes u r rt and thanks 4 ur suggession.
I can use PDH APIs. But I want to know is there any way other than using PDH APIs.
And u mentioned about Windows Management Instrumentation. I don't have much knowledge abt it. Can u pls help me?
Regards,
Ajay
|
|
|
|
|
Ajaywinds wrote: I had created a thread to check the system idle state.
Why not just use GetLastInputInfo() ?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
thanks 4 ur suggession.
Can u pls tell me how can I check the HDD load( other than PDH APIs )
Regards,
Ajay
|
|
|
|