|
I can't understand your question well.
Firstly, you read the file synchronous, so if no fails happens, it will be blocked here if no data income.
I think so, happy to communicate with you !
|
|
|
|
|
Hi All,
I have a wrapper class for the MS Office Products, last time I built it was way back for Office 2000.
I had a set of #imports for that version, but looking in the various directories seem to have changed a bit.
This is what I currently use, has anyone got an updated list for MS Office 2013?
Thanks,
<pre lang="vb">#import "C:\Program Files\Microsoft Office\Office\MSO9.DLL"
#import "C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB"
#import "C:\Program Files\Microsoft Office\Office\MSWORD9.OLB" rename("ExitWindows","_ExitWindows")
//#import "C:\Program Files\Microsoft Office\Office\EXCEL9.OLB" rename("DialogBox","_DialogBox") \
// rename("RGB","_RGB") \
// exclude("IFont","IPicture")
//#import "C:\Program Files\Common Files\Microsoft Shared\DAO\DAO360.DLL" rename("EOF","EndOfFile")\
// rename("BOF","BegOfFile")
//#import "C:\Program Files\Microsoft Office\Office\MSACC9.OLB"
|
|
|
|
|
I think if you generate files from a tlb the paths should automatically come up.
This is of Office 2010
#import "C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE12\\MSO.DLL" no_namespace
A suggestion : Having developed several Office addins, and if you are also doing so, I shall strongly suggest you to use C# .
|
|
|
|
|
Hi Sujayg,
I am trying to create a *.lib file to wrap some of the Word Automation Functions.
So, tell me if I got this all wrong...
I created a Win32 project, selecting MFC and Static Library.
I used Add Class -> MFC Class From Typelib and selected File and used C:\\Program Files\\Microsoft Office\\Office15\\MSWORD.OLB
As I did not know which classes I would need, I just selected them all.
So it generated a lot of Class Header files.
I selected a few Header files for the classes I needed and added #includes for them.
The build created the msword.tlh file etc.
It also gave me over 100 errors, all due to missing items in the msword.tlh file.
In the Add Class step, should I just be selecting the MSWord classes I need, and not just all of them?
Or have I got this whole thing wrong?
It worked OK back in the days of Office 97 and 2000.
BTW, at this stage learning C# is not really an option.
Thanks,
Bryan.
|
|
|
|
|
The steps are correct and it worked fine in Office 2000. I had worked on Word automation in C++ / Office 2000 .
Yes, I could reproduce the errors. Probably we need to make some changes, for working on C++ / Office.
Have a look at [^] ; the steps in which the author makes a change to import. Also check the Word automation using C++ [^] - specially the Solution1.h/cpp and Solution1.h/cpp to view how imports are changed.
Let us know if it helps.
Sujay
|
|
|
|
|
|
Hello Bryan
Thanks for sharing the link as well. I commented the import statement, and it worked fine.
I have checked the functionality of the classes though.
Thanks
Sujay
|
|
|
|
|
I have an application ,need to read hardware IO, each IO data be coded to an unsigned integer, 4 digits - 7 digits.
Quantity of all possible integers is 240, every integer is unique
for example:
1000,1002, 120008, 1318001,14702 , 4003...
After coding step, the coded integers need to be send out in a sequence.
12002 <- 4001 <- 10089 <- 5007 <- ...
Quantity of integers are limited to 128, but, the quantity number is not fixed. Perhaps send-cycle1 is 4 integers,
send-cycle2 is 120 integers,
send-cycle3 is 2 integers,
send-cycle4 is 0 integer.
...
And during cycle period, maybe there are duplicated data be read,but, sending sequence should not take duplicated data.
Logic is :
read data -> already in sequence, discard/ new data -> sequence
I wonder what data structure is good for the above logic and application.
|
|
|
|
|
|
MCU platform, use Hahset is not a good choice.
|
|
|
|
|
In order to get better help you should detail your scenario. For instance, I have no idea of what you mean with
Quote: After coding step, the coded integers need to be send out in a sequence.
12002 <- 4001 <- 10089 <- 5007 <- ...
Veni, vidi, vici.
|
|
|
|
|
Sorry, I mean, I want to send 12007, then 5007, right number after left number.
|
|
|
|
|
Is it a LIFO pattern? In this case std::stack[^] is your answer
|
|
|
|
|
econy wrote: I wonder what data structure is good for the above logic and application.
The problem in this question is that you didn't actually tell us a lot about the logic and application. You only told us about the scope of input values, and that these values are gathered in batches and processed (filtering out duplicates) before sending out.
You didn't tell us if anything of this is time-critical, or you're working with restricted amounts of memory - should we try to optimize for either?
Also, is it more important for the receiver to receive the data in a timely manner, requiring on-the-fly processing so you can send out the batch right after the end of the cycle - or can you afford to delay the processing until after receiving the last input of the cycle, before sending it out?
The answer to these questions will influence what algorithm to use, and the algorithm will influence what data structures to use.
|
|
|
|
|
Hi,
I am writing an application to receive a data from adapter. Adapter is brodcasting UDP data.
So in my case I have two adapter which is connected to same router having following IP information -
1. Adapter 1 :-
IP : 192.168.1.32
Default Gateway : 192.168.1.1
Subnet Mask : 255.255.255.0
2. Adapter 2 :-
IP : 192.168.4.33
Default Gateway : 192.168.4.1
Subnet Mask : 255.255.255.0
Here is the router detail :
Default Gateway : 192.168.1.1
Subnet Mask : 255.255.255.0
PC is also connected to same router.
Application written in C++ is configure to receive data from any IP address.
m_nFamily = AF_INET;
m_nType = SOCK_DGRAM;
m_nProtocol = IPPROTO_UDP;
m_SockAddr.sin_addr.s_addr = INADDR_ANY;
m_SockAddr.sin_family = AF_INET;
In my case I can receive data coming from Adapter 1 but can not receive data coming from Adapter 2.
But the data coming from both the adapter I can see in Wireshark.
Work around to receive data from Adapter 2 : To receive data from adapter 2, I need to change the wireless network connection property for IPV4 and need to change "obtain IP address automatically" to "Use the following address":
Used following data to configure manually :
IP : 192.168.4.31
Default Gateway : 192.168.4.1
Subnet Mask : 255.255.255.0
But after doing this application don't see the message coming from adapter 1.
But the data from both the adapter can be seen in wireshark.
My goal is to receive data from both the adapter simultaneously.
|
|
|
|
|
Have you tried binding your socket to the specific IP addresses?
|
|
|
|
|
Thanks for going through it.
I did not try to bind the socket with specific IP address.
Also this is not a requirement for me. I will give a try just to verify if it is possible but my intention is to receive data from all the adapter connected to same netwoek(router). Earlier I am using DHCP so that time it was not a problem for me cause all the adapter was getting the same default gateway but now I am switching to static where user can put any IP address with different default gateway.
|
|
|
|
|
Also as I can see the data in wireshark, looks like PC is receiving this data but it is not reaching to application
|
|
|
|
|
You will receive messages on the socket that you have created, which will bind to the first adapter. If you wish to receive on both then you need two sockets one bound to each IP address.
|
|
|
|
|
|
Thanks for your valuable suggestion. I am trying all this, I will update you once I will collect the result.
|
|
|
|
|
Hello everybody,
Currently all my C++ project are on a Windows XP machine. For database connections I’m using ado. In stdafx.h I have lines:
#import "c:\Program Files\Common Files\system\ado\msado15.dll" rename_namespace( "ado" ) rename("EOF", "ADOEOF")
#import "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\Resources\1033\sqldmo.rll" no_namespace
And when it’s required I call
ado::_ConnectionPtr pConn = NULL;
hr = pConn.CreateInstance( __uuidof( ado::Connection ) );
Everything has been working fine.
But now I’m moving all my projects to Windows 7 machine. And it appears, that created .exe files are working fine on Windows 7 machine but on Windows XP ado pointer could not be created.
hr = pConn.CreateInstance( __uuidof( ado::Connection ) );
doesn’t create valid connection object.
Thank you in advance, any suggestions will be appreciated
|
|
|
|
|
|
Dear all:
I try to use global hook with WH_GETMESSAGE, but still failed.
It work only on my application, not global. My code show as below:
#pragma data_seg (".SHARED")
HHOOK g_hPreviousMsgHook = 0;
HINSTANCE g_hInstance = 0;
#pragma data_seg()
#pragma comment(linker, "/SECTION:.SHARED,RWS")
BOOL CSoundDllApp::InitInstance()
{
CWinApp::InitInstance();
g_hInstance = AfxGetInstanceHandle();
return TRUE;
}
BOOL InstallWinHook()
{
BOOL bReturn = TRUE;
g_hPreviousMsgHook = SetWindowsHookEx(WH_GETMESSAGE,
&MsgHookProcedure, g_hInstance, 0);
if(NULL == g_hPreviousMsgHook)
{
bReturn = FALSE;
}
return bReturn;
}
LRESULT CALLBACK MsgHookProcedure(int nCode, WPARAM wParam, LPARAM lParam)
{
if(0 > nCode)
return CallNextHookEx(g_hPreviousMsgHook, nCode,
wParam, lParam);
PMSG data = (PMSG)lParam;
switch(data->message)
{
case WM_POINTERDOWN:
Beep(0x7fff, 1000);
break;
}
return CallNextHookEx(g_hPreviousMouseHook, nCode, wParam,
lParam);
}
I set 0 into last parameter of setWindowsHookEx api, but it seem like not work.
Could someone tell me where's wrong, please?
Thanks for your help, Victor
|
|
|
|
|
|