|
You are absolutely right.
Actually the library program is a COM program. It captures an image and then send the image data to by filling the binary image data in the ref string. I am getting the complete data but when i try to get the bytes out of the string, it is not the same as those transmitted by the library program.
( I have already done logging at both ends to compare the binary data. Also i have a lmitation that i cannot change the interface of my library program).
I am sure that the raw image data doesnot follow any of the encoding shceme you have mentioned. The last option for me is to encode the data in the library before sending it to the main application. But this is the last thing i wana do bcz it will almost doubles the size of the data.
So I am looking for an alternative solution in this regard that can work without
encoding the image.
Thanx for your time and support...
Regards..
|
|
|
|
|
Hello
Mursil wrote: last option for me is to encode the data in the library before sending it to the main application
Wait a minute!! Should I understand from this that you wrote that library?? If so, why not passing the data as a bytes array from the begining?
Mursil wrote: It captures an image and then send the image data to by filling the binary image data in the ref string
If it's a 3rd party library and this is what it does. Why can't I see anything special about it?? I mean you can capture an image from the screen as easy as one method: Graphics.CopyFromScreen() , if you are capturing from a camera or a scanner, then maybe the problem is in the library?? How did you know that the data sent by the library is valid?
Regards
|
|
|
|
|
Hi,
Just wanted to ask if any body knows how to add context menu handlers for your custom application, for example, if my application is registered with .abc then there are some verbs that I can set which will work on .abc file. What I am asking is that how to add context menus when the user clicks to any file extension, those menus should appear and then I can set the command parameter for those menus in registry to my own custom application... can any body help
Thanks in advance...
regards,
Waqas
|
|
|
|
|
With a .Net deployment project, you can add new file types to the registry and specify their actions and what applications are invoked when used. But if you're looking to create your own context menu, that's beyond the scope of .Net, and I'm not sure what all you might have to do with the registry to accomplish that.
|
|
|
|
|
hai all.
how to check whether a system is there in a particular network using C#.net... or how can i access a system in the netwaork using c#.
Regards
|
|
|
|
|
what you want to access.
1. Any DB on other machine
2. Any web Service on other machine
3. Any Window service
4. Any remoting Object
5. Serialization
6. Operate other system
7. Extract folder information
8. Display like remote desktop
9. There are many more to go.. what you exactly wants ?
Rizwan Bashir
|
|
|
|
|
hai..
i just want to extract shared folder information of remote system...
Regards
|
|
|
|
|
I'm looking for pointers to code or documentation that will allow me to determine if a file can be opened. I don't mean if the file exists (that is easy enough) but if the file can actually be opened.
I had thought about opening the file in exclusive mode then closing it again, but I don't really want to do that because it would throw an exception if the operation failed (which would at least tell me if it is possible) and I don't regard a failure as exceptional. So, I obviously don't want the overhead of throwing and catching an exception.
|
|
|
|
|
As far as I know the only way is to actually try opening the file
only two letters away from being an asset
|
|
|
|
|
Does anybody know what is the problem in the below code. The InPtr returned by the funcion is always 0 means null. Why?
////////////////
public class ThumbnailExtractor
{
[System.Security.SuppressUnmanagedCodeSecurity]
[DllImport("acdb17.dll", CallingConvention = CallingConvention.Cdecl,
EntryPoint = "?acdbGetPreviewBitmap@@YAPAUtagBITMAPINFO@@PB_W@Z")]
extern static private IntPtr acdbGetPreviewBitmap(string filename);
static Bitmap GetBitmapFromDwg(string filename)
{
return Marshaler.BitmapInfoToBitmap(acdbGetPreviewBitmap(filename));
}
public Bitmap GetImage(string filename)
{
return GetBitmapFromDwg(filename);
}
}
///////////////////
Thanks in advance
|
|
|
|
|
Not sure where this acdb17.dll is coming from, but the EntryPoint is looking really strange.
In most cases you can simply p/invoke functions from Win32 DLLs by just declaring the static method with the same name as the function in the DLL.
The EntryPoint attribute is only neccessary if you want to (or have to) name you function differently.
So I'd suggest trying:
[DllImport("acdb17.dll")]
extern static private IntPtr acdbGetPreviewBitmap(string filename);
Does it work then?
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Im building a Search facility and want to return a set of results (Done!)
The results are displayed in a GridView, but I want the user to click a row and then that client info will pop up in the text boxes:
a Sample:
string ConnectionString = "Data Source='db.sdf';";
SqlCeConnection connection = new SqlCeConnection(ConnectionString);
connection.Open();
string strLastName = textBox1.Text;
string strPostCode = textBox2.Text;
string strEmail = textBox3.Text;
if (!(textBox1.Text == null))
{
string SelectLastName = "SELECT OID, name, lastname, Postcode, Emailad FROM Eaddress WHERE lastname = '" + strLastName + "'";
SqlCeDataAdapter da = new SqlCeDataAdapter(SelectLastName, ConnectionString);
DataSet ds = new DataSet();
da.Fill(ds, "Eaddress");
dataGridView1.DataSource = ds;
dataGridView1.DataMember = "Eaddress";
}
i have two text boxes called textbox1 and textbox2, when user clicks the row the name appears in textbox and lastname appears in textbox2.
example would help very much!!
Palestine
|
|
|
|
|
Look up textbox databinding.
|
|
|
|
|
Can someone explain this with an example of why you need it as part of your own implementation of the Virtual Path Provider class. I have read this over and over in MSDN and other articles and do not get what it's use is in a pratical example.
Palestine
|
|
|
|
|
Hello,
I was thinking the other day about how I would solve the following problem, but I just couldn't seem to come up with a really logical solution... or at least what I would think is a best practice. How would you handle the following?
Say I have winform client apps... any number of them. Lets say that this app has a couple web services. Okay, now lets say that one of the web service is like a broker web service... it also contains other web services. The client isn't aware of all the web services the broker service is hitting, the broker is responsible for knowing that. The point here is that we have a web service which may hit another web service, could be anything. Now, here's the hard part... getting all of the errors in case one happens. So client requests data from Service1. Service one then hits Service2, Service3 and Service4. Service3 errors out because the server that it's on is down. Service4 errors out because of a database issue or something. I want to return something back to the client listing all of the details of why the transaction failed (like in a log file or something), like
Success: Transaction to Service1 was successful
Success: Transaction to Service2 was successful
Error: Could not access Service3.
Error: Duplicate Primary Keys in Service4.
How do I handle this? Lets take it to another level and say that Service2 in itself might contain other services, so the transaction to Service2 was successful, but the transaction to Service2a failed for some reason.
The trick is keeping a single log file that contains all of the details on why various services failed, even if those service contain services which may have failed for some reason. What's the best way to handle something like this? I can't have every method return a bool if it passes or fails because it might already have a return value... So I can't just call GetData on Service2 and return a bool whether it passed or failed because it might already return a dataset... Does this make sense?
Keep in mind this is hypothetical, but I am just wondering what the best practice is in handling this type of scenerio.
Thanks!
Palestine
|
|
|
|
|
Hello
In your scenario, I believe the best practice would be messages. Each message contains the sender info, and the error message. The protocole, or implementation is totally up to you. There are million ways to communicate between different applications and services.
Hints:
- You can return success/failure messages, or only failure messages.
- You can put your messages in a queue and check it periodically, or handle it promptly.
- You can send the error message in the service output, or send it in a private stream.
I hope this would throw some light
Regards
|
|
|
|
|
I'd say instead of returning a bool type, return a object[] type. The elements in the object array can then be anything. Thus retuning a whole package of info regarding what had happend during the call to Service3. The return return object can tell you for example:
obj[0] : failed/success
obj[1] : error message
obj[2] : error code
obj[3] : some other usefull return
This obviously means that the size of the package returned might be big; in terms of bool bytes vs. object[] bytes.
i hope this helps.
|
|
|
|
|
I have a View menu item that offiers Large Icon, Details..... views. I would like to have the menu item have a checked sign when selected by a user and then remove the check sign when user selects a different view option.
Thank you.
Palestine
|
|
|
|
|
Tried It out and worked fine.
private void m_SortItem_Click(object sender, EventArgs e)
{
//Clearing check marks from all menu items
foreach (ToolStripMenuItem item in sortToolBtn.DropDownItems)
{
item.Checked = false;
}
//Selected the current item which is clicked.
m_SortItem.Checked = true;
}
|
|
|
|
|
Task Description:
Input to my Web Service From MQ Message Queue
The complete XML will be sent from the Message Queue
- <soapbody>
<parameter>'' 'C:\ofac\out\file110' 'cl_110' 'LN ONE' 'LN2' 'LN3' 'LN4' 'LN5' 'LN6' 'LN7' 'LN8' 'LN9' 'CN' 'PN' 'OTHERName' 'COUNTRY' 'DATA KHFUOISDUFIOUDFOIFUIOD BODY'
I want to read the parameter and send the
parameter Data forward to a process.
The results of the process should replace the value of parameter
and return the complete message received from the
queue.
I continually get this message when starting debug:
The property 'OneWay' on type 'System.Web.Services.Protocols.SoapMessage' cannot be serialized because it is decorated with declarative security permission attributes. Consider using imperative asserts or demands in the property accessors.
I am using Visual Studio .Net For development
Here's my code Snippet:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Configuration;
using System.Security;
using System.Security.Permissions;
using System.Data.SqlClient;
using System.Reflection;
using System.Xml;
namespace WebServiceGL1Way
{
///
/// Summary description for Service1.
///
//[WebService(Namespace="http://10.1.21.58/GlobalOneWay")]
public class Service1 : System.Web.Services.WebService, System.Security.IPermission
{
public Service1()
{
//CODEGEN: This call is required by the ASP.NET Web Services Designer
InitializeComponent();
}
#region Component Designer generated code
//Required by the Web Services Designer
private IContainer components = null;
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
#endregion
// WEB SERVICE EXAMPLE
// The HelloWorld() example service returns the string Hello World
// To build, uncomment the following lines then save and build the project
// To test this web service, press F5
//[SoapDocumentMethod(OneWay=true)] - shot in the dark
[WebMethod]
public string GlobalService1(SoapMessage message)
{
//string msg = message.GetInParameterValue(0).ToString(); - don't know which one will get value!!!??
object param = message.GetType().BaseType.GetField("parameter");
string msg = param.ToString();
string sRunBuildXML = msg;
RunProcess(Session["BuildXML_Path"].ToString(),sRunBuildXML);
// replace returned message within element parameter
return message;
}
//............
What is missing?
Is the input formatted correctly as a soap message?
Is it really a string?
Palestine
|
|
|
|
|
1. I have a DataGrid.
2. I have a Form.
3. I have an Access DB.
4. I have a dataset.
The Form data is inserted into my DB in an isolated transaction.
After that transaction has completed, I reload my dataset which is binded to the DataGrid. I use a connection instance for me insert transaction, and another connection object for my "selects". Even though both connection objects are created from the same connection string (appended below), the data seems to not be updated with a follow up my completed transaction with a search on the newly inserted data.
Basically the data I'm submitting is not show up in my datagrid. It's like I have to wait a few seconds and search again to find it. Is Access really that slow. Why would it complete my insert and transaction if it's not done.
Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=$$$\DocuBase.mdb;Mode=Share Deny None;Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False
Palestine
|
|
|
|
|
You'll have to use one instnce troughout your app(or form) of the adapter(adp1) and assosiated connection(con) when selecting, inserting, deleteing and updateing of the dataset(ds) if you want the data to be concurrent within your grid and reflect changes as it happens. The concurrency behind the dataset & grid are maintained by currencymanagers and currency happens 'automaticlly', but you'll have to use the original instances of dataset, adapter, commands and connections objects to preserve currency of the datasets and keep them in context of its original 'data factories'.
If you have 2 adapter; one for selecting and one for insetingon the same dataset table, you will have concurrency problems. Rember that the adapter knows the states of the rows during an fill or update - the adapter only gets/changes the rows whos states has changed and/or are different as those rows in the db.
you should buy a book explaning these stuff to you. Datasets are very powerfull, but they can irretate the hell out of you if you use it the wrong way.
|
|
|
|
|
I have upgraded from .net framework 1.1 to 2.0 and also changed from MS VisualStudio 2003 to 2005. My program was obsolutely working fine 2003 and i am getting the desired output.
I will tell the problem what it is, when i debug the appln. it is not going in to the method but just skipping that stmt . when i point the cursor to that line, it is showing the message "remove group, currently there is no group object."
here is the method where the problem lies
Hashtable htable = mUsersGroups.GetAllUsersAndIDs();
There is nothing wrong with the method and i got the output what i want in 2003 version , but the problem is doesn't filter acc. to group and show all the groups. But anyhow i can give the code for u'r better understanding.
public Hashtable GetAllUsersAndIDs()
{
long userGroupID;
UGUserNode user;
SqlConnection dbc = new SqlConnection(Config.ConnectionString);
Hashtable userTable = new Hashtable();
dbc.Open();
try
{
SqlCommand sqlCommand = new SqlCommand(
"SELECT DISTINCT UserGroupID, Name " +
"FROM UserGroupTable " +
"ORDER BY Name",
dbc);
SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
while (sqlDataReader.Read())
{
if (!sqlDataReader.IsDBNull(0))
{
userGroupID = sqlDataReader.GetInt32(0);
if (nodes.ContainsKey(userGroupID))
{
//we have already seen this node!
user = (UGUserNode) nodes[userGroupID];
}
else
{
user = new UGUserNode();
user.LoginName = sqlDataReader.GetString(1);
user.UserGroupID = sqlDataReader.GetInt32(0);
user.IsActive = true;
nodes.Add(userGroupID, user);
}
userTable.Add(userGroupID,nodes[userGroupID]);
}
}
sqlDataReader.Close();
}
catch(Exception e)
{ Console.WriteLine(e.Message);}
finally {dbc.Close();}
return userTable;
}
I am not familiar with the MS VisualStudio 2005 and could not figure out what the problem is and can u resolve the problem and reply with the complete solution please,
Thanks,
Palestine
|
|
|
|
|
|
The first one can be achieved with GraphicsPath.AddArc() , followed by GraphicsPath.AddLine() to add the lower horizontal line. When you call FillPath() on your given Graphics object, the path will be closed automatically.
The second one is very similar, you'll add an Arc , a Line , and another Arc . You might have to set GraphicsPath.FillMode to FillMode.Winding in the second case or you'll get unexpected results.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|